楼主: 柳叶飘零
4936 2

回归分析中两个虚拟变量之间为何加#? [推广有奖]

  • 3关注
  • 3粉丝

已卖:76份资源

硕士生

42%

还不是VIP/贵宾

-

威望
0
论坛币
910 个
通用积分
2.3456
学术水平
0 点
热心指数
1 点
信用等级
0 点
经验
249 点
帖子
113
精华
0
在线时间
159 小时
注册时间
2012-4-30
最后登录
2024-1-19

楼主
柳叶飘零 学生认证  发表于 2012-10-14 22:08:01 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
最近在学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















二维码

扫码加我 拉你入群

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

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

关键词:两个虚拟变量 虚拟变量 回归分析 WorkPlace Incidence incidence workplace 回归分析 white 网上

沙发
大白菜2012 发表于 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
元芳,侬怎么L00K?

藤椅
柳叶飘零 学生认证  发表于 2012-10-15 12:21:15
大白菜2012 发表于 2012-10-14 23:12
#代表interaction.

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

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-29 15:31