数据为2013年CGSS数据,想通过 成员关系 、年龄以及是否共同居住,将家庭结构划分为四类,分别为纯老家庭,中老家庭,中幼家庭还有老中幼三代。纯老就是家庭中只有老人的 中老就是中年人加老人 中幼就是中年人加小孩 联合就是三代人都有。有哪位仁兄对此类数据进行分析过,帮忙写个dofile
我个人写的应该是有问题的,不知道怎么进行了。本人写的如下:
Whether to live together
foreach i of numlist 2/9 {
g live`i'=a150`i'
}
foreach i of numlist 10/15 {
g live`i'=a15`i'
}
foreach i of numlist 2/15 {
replace live`i'=1 if live`i'==2
replace live`i'=0 if live`i'==3
replace live`i'=0 if live`i'==4
}
Relationship of family members
foreach i of numlist 1/9 {
g guanxi`i'=a1320`i'
}
foreach i of numlist 10/14{
g guanxi`i'=a132`i'
}
age of family members
g age1=2013-a3a
foreach i of numlist 2/9 {
g age`i'=a140`i'
}
foreach i of numlist 10/15 {
g age`i=a14`i' 后面的进行分类的时候有点困难 请求


雷达卡




京公网安备 11010802022788号







