全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
4598 9
2009-06-07
<p>我在使用logistic回归中遇到一个问题:(以下为我的应用过程及问题)</p><p>gen fardeau=.<br/>(686 missing values generated)<br/><br/>. replace fardeau=1 if totzarit<=20<br/>(320 real changes made)<br/><br/>. replace fardeau=2 if totzarit>=21 & totzarit<=40<br/>(235 real changes made)<br/><br/>. replace fardeau=3 if totzarit>=41 & totzarit<=60<br/>(65 real changes made)<br/><br/>. replace fardeau=4 if totzarit>=61 & totzarit<=88<br/>(18 real changes made)<br/><br/>. tab fardeau,missing<br/><br/>    fardeau |      Freq.     Percent        Cum.<br/>------------+-----------------------------------<br/>          1 |        320       46.65       46.65<br/>          2 |        235       34.26       80.90<br/>          3 |         65        9.48       90.38<br/>          4 |         18        2.62       93.00<br/>          . |         48        7.00      100.00<br/>------------+-----------------------------------<br/>      Total |        686      100.00<br/><br/></p><p>xi:logit stable i.fardeau<br/>i.fardeau         _Ifardeau_1-4       (naturally coded; _Ifardeau_1 omitted)<br/><br/><font color="#ff0000">note: _Ifardeau_4 != 0 predicts failure perfectly</font><br/> <font color="#ff0000">     _Ifardeau_4 dropped and 1 obs not used</font></p><p><font color="#ff0000">(我想找到一个命令,可以阻止</font><font color="#ff0000">_Ifardeau_4被删除,而且象前3项一样得出数据分析。不知哪位高手可以指点我这个菜鸟</font><font color="#ff0000">)</font><br/><br/>Iteration 0:   log likelihood = -95.043737<br/>Iteration 1:   log likelihood =  -94.13092<br/>Iteration 2:   log likelihood = -94.070877<br/>Iteration 3:   log likelihood = -94.070021<br/>Iteration 4:   log likelihood = -94.070021<br/><br/>Logistic regression                               Number of obs   =        170<br/>                                                  LR chi2(2)      =       1.95<br/>                                                  Prob > chi2     =     0.3777<br/>Log likelihood = -94.070021                       Pseudo R2       =     0.0102<br/><br/>------------------------------------------------------------------------------<br/>      stable |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]<br/>-------------+----------------------------------------------------------------<br/> _Ifardeau_2 |  -.1040009   .3706763    -0.28   0.779    -.8305131    .6225113<br/> _Ifardeau_3 |  -1.287354   1.074473    -1.20   0.231    -3.393283    .8185743<br/>       _cons |  -1.015231   .2334368    -4.35   0.000    -1.472758   -.5577029<br/>------------------------------------------------------------------------------<br/><br/></p>

[此贴子已经被作者于2009-6-7 21:14:49编辑过]

二维码

扫码加我 拉你入群

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

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

全部回复
2009-6-7 21:28:00

把虚拟变量的相关知识看看

 

二维码

扫码加我 拉你入群

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

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

2009-6-7 22:09:00

回复:(eblog)把虚拟变量的相关知识看看 

以下是引用eblog在2009-6-7 21:28:00的发言:

把虚拟变量的相关知识看看                                                                                                                                                                                   

请问楼上的高手,可否说得更具体些,我应该看虚拟变量相关的那些内容?本人确实是能力有限,特在此求教。

二维码

扫码加我 拉你入群

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

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

2009-6-8 07:54:00
可不可以先把你的stable与totzarit的数据帖出来?
二维码

扫码加我 拉你入群

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

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

2009-6-8 08:57:00
以下是引用nolen56在2009-6-7 21:13:00的发言:

gen fardeau=.
(686 missing values generated)

. replace fardeau=1 if totzarit<=20
(320 real changes made)

. replace fardeau=2 if totzarit>=21 & totzarit<=40
(235 real changes made)

. replace fardeau=3 if totzarit>=41 & totzarit<=60
(65 real changes made)

. replace fardeau=4 if totzarit>=61 & totzarit<=88
(18 real changes made)

*这几步可以一步实现:

recode totzarit (min/20=1)(21/40=2)(41/60=3)(61/88=4)(else=.),g(fardeau)

[此贴子已经被作者于2009-6-8 8:59:02编辑过]

二维码

扫码加我 拉你入群

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

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

2009-6-8 18:00:00

回复:(sungmoo)可不可以先把你的stable与totzarit的...

Gen vmms=totmms4a - totmms

sum vmms
Variable Obs Mean Std. Dev. Min Max 
vmms 184 -7.141304 5.745193 -26 9 

list numcp totmms4a vmms if vmms==. & totmms4a!=.
Numcp Totmms Totmms4a Vmms 
16141 . 16 . 

3)
sum vmms,det
gen vmms4=.
replace vmms4=1 if vmms<=-11
replace vmms4=2 if vmms>-11 & vmms<=-7
replace vmms4=3 if vmms>-7 & vmms<=-3
replace vmms4=4 if vmms>-3 & vmms<.

tab vmms4
vmms4 Freq. Percent Cum. 
1 51 27.72 27.72 
2 48 26.09 53.80 
3 40 21.74 75.54 
4 45 24.46 100.00 
Totle 184 100.00  


4)
gen stable=0
replace stable=1 if vmms4==4
replace stable=. if vmms==.

tab stable, miss
stable Freq. Percent Cum. 
0 139 20.26 20.26 
1 45 6.56 26.82 
. 502 73.18 100.00 
Total 686 100.00

 sum totzarit

  Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
  totzarit | 638 22.60815 15.8566 0 82

. sum totzarit,det

  zarit total t0
-------------------------------------------------------------
  Percentiles Smallest
 1% 0 0
 5% 2 0
10% 4 0 Obs 638
25% 10 0 Sum of Wgt. 638

50% 20 Mean 22.60815
  Largest Std. Dev. 15.8566
75% 33 71
90% 44 71 Variance 251.4318
95% 55 72 Skewness .8159247
99% 68 82 Kurtosis 3.345145

还请sungmoo多指教



二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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