- 阅读权限
- 255
- 威望
- 13 级
- 论坛币
- 1100397 个
- 通用积分
- 78895.5417
- 学术水平
- 3454 点
- 热心指数
- 3913 点
- 信用等级
- 2749 点
- 经验
- 472847 点
- 帖子
- 11699
- 精华
- 5
- 在线时间
- 20308 小时
- 注册时间
- 2004-7-15
- 最后登录
- 2026-1-3
|
12楼
蓝色
发表于 2012-9-28 00:39:39
naujkz 发表于 2012-9-27 14:00 
再次感谢! **************************************************************************************
clear
import excel "D:\temp\Demo.xls", sheet("Sheet1") firstrow clear
gen str8 sex=cond(Rgender==1,"father","mother")
tab sex Rgender
reshape wide ID Birth Marital Hukou School Education A024 Rgender,i(communityID householdID ) j(sex) str
sort communityID householdID
saveold "D:\temp\Demo.dta",replace
*******************************************************************************************
clear
import excel "D:\temp\Child.xls", sheet("Sheet1") firstrow clear
sort communityID householdID
merge m:1 communityID householdID using "D:\temp\Demo.dta"
saveold "D:\temp\Child.dta",replace
export excel using "D:\temp\Child_Demo.xls", firstrow(variables) replace
******************************************************************************************
|
|