全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
5578 5
2015-12-14
在multinomial logistic regression里,其中一个多值自变量kids的取值有none,both,son和daughter。在回归的时候 i.kids 的基准组自动使用了both,我想换成none,请问该用什么指令呢
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2015-12-14 05:53:38
可以参考help fvvarlist
相关部分引用如下
Base levels

    You can specify the base level of a factor variable by using the ib. operator.  The syntax is

           Base         
           operator(*)    Description
           -----------------------------------------------------------------------------------------------------------
           ib#.           use # as base, #=value of variable
           ib(##).        use the #th ordered value as base (**)
           ib(first).     use smallest value as base (the default)
           ib(last).      use largest value as base
           ib(freq).      use most frequent value as base
           ibn.           no base level
           -----------------------------------------------------------------------------------------------------------
            (*) The i may be omitted.  For instance, you may type ib2.group or b2.group.
           (**) For example, ib(#2). means to use the second value as the base.

    Thus, if you want to use group=3 as the base in a regression, you can type

        . regress y  i.sex ib3.group

    You can also permanently set the base levels of categorical variables by using the fvset command.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-12-14 13:21:03
夏目贵志 发表于 2015-12-14 05:53
可以参考help fvvarlist
相关部分引用如下
十分感谢!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-12-14 14:21:48
把各变量手动设成dummy。

例如
gen dum_none  = (kids == 1)
gen dum_both  = (kids == 2)
gen dum_son  = (kids == 3)
gen dum_daughter  = (kids == 4)
kids等于几要看stata如何默认的。

以none为base回归的时候,
mlogit y dum_both  dum_son  dum_daughter x, base(1) vce(robust)
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2018-1-14 14:24:47
学习一下。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2018-1-14 14:30:52
help fvvarlist 可以进行系统学习
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群