stATA 导入EXCEL 并附加值标签

. export excel using "D:\statashu\221.xls", firstrow(variables) nolabel
//将当前表导出为xls,第一行作为标题,没有值标签

//导入xls,第一行作为变量名
import excel "D:\statashu\221.xls", sheet("Sheet1") firstrow clear
//建立值标签 origin
label define origin 0 "Domestic",modify
label define origin 1 "Foreign",modify
//将值标签附加给变量foreign
 label values foreign origin

 

posted @ 2023-03-19 20:48  myrj  阅读(442)  评论(0编辑  收藏  举报