0
点赞
收藏
分享

微信扫一扫

stata数据处理0304

松鼠树屋 2022-03-16 阅读 50

stata基本处理

  • stata str转number help destring
  • 我发现 destring ,replace 可以全部变量都换成long…

分类变量 如何放入回归?
1)通过 code tripType 显示此变量的类型,如下

tripType

type: string (str8)

tabulation: Freq. Value

output:2,164 “BUSINESS”
3,519 “COUPLES”

renvars wage race, postfix(_new) // 批量增加后缀

生成虚拟变量
变量分类少的
tab race, gen(dum_race)
多的

排序分组
sort wage // 变量排序【注意】
gen g_wage = group(5) // 变量分组
tab g_wage

举报

相关推荐

0 条评论