全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
4861 2
2012-10-14
最近在学stata,在做简单一元线性回归时看见例子里有把两个虚拟变量之间加#,问一下这样做有什么用?我用的是stata网上的数据。代码如下:
webuse byssin
(Byssinosis incidence)

regress prob workplace smokes race workplace#smokes [aw=pop]

结果是
捕获.PNG

问下如果把workplace#smokes当做一个新变量,但是变量不取(1,1)呢?

还有那个取(3,1),(3,2)会出现共线性是怎么回事?,原数据如下,希望高手能帮我解答。
smokes        race        workplace        pop        prob
yes        white        most        40        .075
yes        white        less        74        0
yes        white        least        260        .0076923
yes        other        most        164        .152439
yes        other        less        88        0
yes        other        least        245        .0122449
yes        white        most        5        0
yes        white        less        94        .0106383
yes        white        least        183        .0163934
yes        other        most        24        .0833333
yes        other        less        147        .0136054
yes        other        least        263        .0114068
no        white        most        16        0
no        white        less        35        0
no        white        least        134        0
no        other        most        81        .0740741
no        other        less        48        .0208333
no        other        least        123        .0081301
no        white        most        4        0
no        white        less        55        .0181818
no        white        least        171        .0116959
no        other        most        25        .04
no        other        less        145        .0206897
no        other        least        305        .0131148
yes        white        most        29        .2758621
yes        white        less        51        .0196078
yes        white        least        188        .0053191
yes        other        most        38        .2105263
yes        other        less        5        0
yes        other        least        33        0
yes        white        most        0        
yes        white        less        34        .0294118
yes        white        least        96        .0208333
yes        other        most        0        
yes        other        less        4        0
yes        other        least        3        0
no        white        most        10        .2
no        white        less        17        .0588235
no        white        least        58        0
no        other        most        10        .1
no        other        less        0        
no        other        least        7        0
no        white        most        0        
no        white        less        30        0
no        white        least        91        .010989
no        other        most        0        
no        other        less        4        0
no        other        least        4        0
yes        white        most        108        .287037
yes        white        less        142        .0070423
yes        white        least        507        .0236686
yes        other        most        41        .2439024
yes        other        less        1        0
yes        other        least        45        0
yes        white        most        1        0
yes        white        less        94        .0319149
yes        white        least        179        .0167598
yes        other        most        1        0
yes        other        less        0        
yes        other        least        2        0
no        white        most        52        .0961538
no        white        less        39        0
no        white        least        185        .0162162
no        other        most        18        .1666667
no        other        less        1        0
no        other        least        23        0
no        white        most        2        0
no        white        less        190        .0157895
no        white        least        342        .005848
no        other        most        0        
no        other        less        2        0
no        other        least        3        0















二维码

扫码加我 拉你入群

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

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

全部回复
2012-10-14 23:12:27
#代表interaction.

see "help fvvarlist"

i.group#i.sex     indicators for each combination of levels of group and sex, a
                             two-way interaction
二维码

扫码加我 拉你入群

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

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

2012-10-15 12:21:15
大白菜2012 发表于 2012-10-14 23:12
#代表interaction.

see "help fvvarlist"
多谢了哈,你真牛啊
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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