楼主: 迷途小鹿
7944 9

【求助】stata虚变量0、1的样本比例问题 [推广有奖]

  • 0关注
  • 1粉丝

已卖:3份资源

硕士生

57%

还不是VIP/贵宾

-

威望
0
论坛币
262 个
通用积分
5.1844
学术水平
0 点
热心指数
1 点
信用等级
0 点
经验
2464 点
帖子
127
精华
0
在线时间
207 小时
注册时间
2009-9-15
最后登录
2023-12-28

楼主
迷途小鹿 发表于 2012-10-23 10:21:30 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
入门级菜鸟捂脸求助
(各种翻书、搜索没有找到答案,大侠们就不要让我自己去解决了,知道的一定要伸出援手啊)
用stata做logit,有一个虚变量被dropped,理由是x13 != 0 predicts failure perfectly
我分析原因,可能是由于该虚变量取值为0的太多,而取值为1的又太少
详细样本情况是这样的
样本总数:191
虚变量a:69
虚变量b:8
虚变量c:22
虚变量d:28
虚变量e:26
虚变量f:1
虚变量g:9
虚变量h:5

上面所说的被dropped的虚变量就是f,估计结果的样本数变为190

求解释:虚变量0、1的赋值比例应该在多少?是不是只有1个样本赋值为1就要被dropped?
二维码

扫码加我 拉你入群

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

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

关键词:Stata tata perfectly predicts dropped 样本

沙发
大白菜2012 发表于 2012-10-23 22:01:35
it is called perfect prediction.

http://www.ats.ucla.edu/stat/mul ... on_logit_models.htm


A complete separation happens when the outcome variable separates a predictor variable or a combination of predictor variables completely. Albert and Anderson (1984) define this as, "there is a vector α that correctly allocates all observations to their group." Below is a small example.

Y X1 X2
0 1  3
0 2  2
0 3 -1
0 3 -1
1 5  2
1 6  4
1 10 1
1 11 0

In this example, Y is the outcome variable, X1 and X2 are predictor variables. We can see that observations with Y = 0 all have values of X1<=3 and observations with Y = 1 all have values of X1>3. In other words, Y separates X1 perfectly. The other way to see it is that X1 predicts Y perfectly since X1<=3 corresponds to Y = 0 and X1 > 3 corresponds to Y = 1. By chance, we have found a perfect predictor X1 for the outcome variable Y. In terms of predicted probabilities, we have Prob(Y = 1 | X1<=3) = 0 and Prob(Y=1 X1>3) = 1, without the need for estimating a model.
元芳,侬怎么L00K?

藤椅
fgleric 发表于 2012-10-24 02:19:16
大白菜2012 发表于 2012-10-23 22:01
it is called perfect prediction.

http://www.ats.ucla.edu/stat/mult_pkg/faq/general/complete_separ ...
多谢大白菜!
第一次知道这种情况,以及怎么去处理。

刚做了一下研究,也有人针对这个问题做了解决方案。有兴趣,参加
http://artsandsciences.sc.edu/poli/psrw/Zorn_PA_Final.pdf

板凳
大白菜2012 发表于 2012-10-24 04:27:15
fgleric 发表于 2012-10-24 02:19
多谢大白菜!
第一次知道这种情况,以及怎么去处理。
thanks for sharing
元芳,侬怎么L00K?

报纸
迷途小鹿 发表于 2012-10-24 09:21:48
大白菜2012 发表于 2012-10-23 22:01
it is called perfect prediction.

http://www.ats.ucla.edu/stat/mult_pkg/faq/general/complete_separ ...
多谢大白菜帮我认清了问题

地板
迷途小鹿 发表于 2012-10-24 09:22:44
fgleric 发表于 2012-10-24 02:19
多谢大白菜!
第一次知道这种情况,以及怎么去处理。
多谢分享文献。。。我还是选择删除这个样本吧,毕竟只有1个

7
大白菜2012 发表于 2012-10-24 11:15:52
迷途小鹿 发表于 2012-10-24 09:22
多谢分享文献。。。我还是选择删除这个样本吧,毕竟只有1个
or you can drop that f variable.

before you make any decisions, please make sure the values of f variable are correctly defined.
元芳,侬怎么L00K?

8
迷途小鹿 发表于 2012-10-24 12:55:25
大白菜2012 发表于 2012-10-24 11:15
or you can drop that f variable.

before you make any decisions, please make sure the values of ...
多谢建议!
我试过去掉f虚变量,其实结果也是可以的。。。但是这种方法也有问题,我做回归的时候用的变量是b一直到h,也就是说a是一个参照,如果去掉f,那么不就等同于有a、f两个参照了吗?

9
大白菜2012 发表于 2012-10-24 12:59:58
迷途小鹿 发表于 2012-10-24 12:55
多谢建议!
我试过去掉f虚变量,其实结果也是可以的。。。但是这种方法也有问题,我做回归的时候用的变量 ...
恩,对。保留f
元芳,侬怎么L00K?

10
ruthqi1989 发表于 2018-5-16 16:03:05
fgleric 发表于 2012-10-24 02:19
多谢大白菜!
第一次知道这种情况,以及怎么去处理。
求针对该问题的解决办法,打开网址找不到pdf文件,非常感谢

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-30 02:13