stata将月份重新编码为季节
答案:2 悬赏:80
解决时间 2021-02-21 15:27
- 提问者网友:寂寞撕碎了回忆
- 2021-02-21 09:02
stata将月份重新编码为季节
最佳答案
- 二级知识专家网友:轻雾山林
- 2021-02-21 09:22
如果月份变量名字是month,则编码如下:
gen spring=(month==3|month==4|month==5)
summer 则把括号中的3 4 5分别改为6 7 8
再生成season变量
gen season=1 if spring==1
replace season=2 if summer==1
replace season=3 if antumn==1
replace season=4 if winter==1
gen spring=(month==3|month==4|month==5)
summer 则把括号中的3 4 5分别改为6 7 8
再生成season变量
gen season=1 if spring==1
replace season=2 if summer==1
replace season=3 if antumn==1
replace season=4 if winter==1
全部回答
- 1楼网友:一秋
- 2021-02-21 10:43
用条件语句就可以完成这个分析
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯