楼主: bhxbzs
26580 11

[回归分析求助] logit模型进行二值选择分析的一个疑问 [推广有奖]

  • 1关注
  • 1粉丝

硕士生

11%

还不是VIP/贵宾

-

威望
0
论坛币
651 个
通用积分
2.5500
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
664 点
帖子
43
精华
0
在线时间
190 小时
注册时间
2012-10-1
最后登录
2024-11-2

楼主
bhxbzs 发表于 2016-3-6 09:50:21 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
各位前辈,本人在自学Stata中,今天根据教材用logit命令建立二值选择模型,在出现的结果中,准R2的值为0.1882,应该说拟合优度不是很好。 1111111.png
但是在接下来用estat classification 来计算模型的拟合优度,得到的结果为73.65%
222222.png
再用ROC曲线来估计预测准确率为78.06%
3333333.png




感觉与之前准R2的结果矛盾啊,准R2的值只有0.1882,但是后面的两项拟合优度检验都达到了70%+,这是为什么呢?
我是在同时自学计量经济和stata,之前零基础,可能有些地方理解的不对,还请大家指点下~
二维码

扫码加我 拉你入群

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

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

关键词:logit模型 logit Log cation 拟合优度检验 模型

回帖推荐

xddlovejiao1314 发表于2楼  查看完整内容

logit模型结果中的准R2和后面的预测准确率都是判断其拟合好坏的指标。不过由于logit模型是一个非线性模型,所以准R2的计算一般只做一个参考。大家一般看预测准确率的。此外,准R2低也并不一定代表模型不好,它只是表示你模型中还遗漏了很多可能与因变量有关的自变量而已,只要这些遗漏的变量是外生的,就没问题的(而遗漏的变量是否严格外生,这点没法判断)。其实只要模型系数是显著的,整体是显著的就好的。祝好运~

沙发
xddlovejiao1314 学生认证  发表于 2016-3-6 10:05:06
    logit模型结果中的准R2和后面的预测准确率都是判断其拟合好坏的指标。不过由于logit模型是一个非线性模型,所以准R2的计算一般只做一个参考。大家一般看预测准确率的。此外,准R2低也并不一定代表模型不好,它只是表示你模型中还遗漏了很多可能与因变量有关的自变量而已,只要这些遗漏的变量是外生的,就没问题的(而遗漏的变量是否严格外生,这点没法判断)。其实只要模型系数是显著的,整体是显著的就好的。祝好运~

藤椅
bhxbzs 发表于 2016-3-6 10:16:16
xddlovejiao1314 发表于 2016-3-6 10:05
logit模型结果中的准R2和后面的预测准确率都是判断其拟合好坏的指标。不过由于logit模型是一个非线性模 ...
明白了,多谢指点

板凳
qq87257410 发表于 2016-3-6 10:21:28 来自手机
对的,一楼说的好~看系数显著性和联合显著性~R方参考就好,R方太大还有编造的嫌疑呢

报纸
bhxbzs 发表于 2016-3-6 10:42:06
xddlovejiao1314 发表于 2016-3-6 10:05
logit模型结果中的准R2和后面的预测准确率都是判断其拟合好坏的指标。不过由于logit模型是一个非线性模 ...
另外,大神,能否告知下,Stata中对logit二值选择模型进行异方差检验的命令是啥?
我的教程上只介绍了Stata中对probit二值选择模型进行异方差检验和回归,即 hetprob work age education married children, het (age education married children)

如何我用的是logit进行的回归的,那么检验命令是什么?

地板
xddlovejiao1314 学生认证  发表于 2016-3-6 11:07:45
bhxbzs 发表于 2016-3-6 10:42
另外,大神,能否告知下,Stata中对logit二值选择模型进行异方差检验的命令是啥?
我的教程上只介绍了St ...
呵呵,logit模型异常差检验命令是啥我还真不清楚。不过如果你想得到稳健的结果,可以在命令语句后面加一个robust命令呗。logit y x, r。祝好运~

7
bhxbzs 发表于 2016-3-6 12:29:24
xddlovejiao1314 发表于 2016-3-6 11:07
呵呵,logit模型异常差检验命令是啥我还真不清楚。不过如果你想得到稳健的结果,可以在命令语句后面加一个 ...
恩,好,以后有问题再向您请教哈

8
ericwing1229 发表于 2016-8-18 16:36:06
请问,为什么我的面板数据logit回归结果中没有报告Pseudo R2的值?

9
黃河泉 在职认证  发表于 2016-8-18 17:04:25
ericwing1229 发表于 2016-8-18 16:36
请问,为什么我的面板数据logit回归结果中没有报告Pseudo R2的值?
  1. . xtlogit union age grade i.not_smsa south##c.year, fe
  2. note: multiple positive outcomes within groups encountered.
  3. note: 2,744 groups (14,165 obs) dropped because of all positive or
  4.       all negative outcomes.

  5. Iteration 0:   log likelihood = -4516.5881  
  6. Iteration 1:   log likelihood = -4510.8906  
  7. Iteration 2:   log likelihood =  -4510.888  
  8. Iteration 3:   log likelihood =  -4510.888  

  9. Conditional fixed-effects logistic regression   Number of obs     =     12,035
  10. Group variable: idcode                          Number of groups  =      1,690

  11.                                                 Obs per group:
  12.                                                               min =          2
  13.                                                               avg =        7.1
  14.                                                               max =         12

  15.                                                 LR chi2(6)        =      78.60
  16. Log likelihood  =  -4510.888                    Prob > chi2       =     0.0000

  17. ------------------------------------------------------------------------------
  18.        union |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
  19. -------------+----------------------------------------------------------------
  20.          age |   .0710973   .0960536     0.74   0.459    -.1171643    .2593589
  21.        grade |   .0816111   .0419074     1.95   0.051    -.0005259     .163748
  22.   1.not_smsa |   .0224809   .1131786     0.20   0.843     -.199345    .2443069
  23.      1.south |  -2.856488   .6765694    -4.22   0.000    -4.182539   -1.530436
  24.         year |  -.0636853   .0967747    -0.66   0.510    -.2533602    .1259896
  25.              |
  26. south#c.year |
  27.           1  |   .0264136   .0083216     3.17   0.002     .0101036    .0427235
  28. ------------------------------------------------------------------------------

  29. . scalar r2 = e(r2_p)

  30. . scalar list r2
  31.         r2 =  .00863656
复制代码

10
蓝色 发表于 2016-8-19 08:39:25
用什么命令,就要查看那个命令的帮助文件或者manual文件。
才能知道这个命令到底能提供什么。
你查xtlogit,看帮助的最后,已经列出一些保留值(一些屏幕是不显示的,所以需要查帮助文件),
其中fe里面是有pseudo R-squared.




Title


    [XT] xtlogit -- Fixed-effects, random-effects, and population-averaged logit models
Syntax
    Random-effects (RE) model
        xtlogit depvar [indepvars] [if] [in] [weight] [, re RE_options]
    Conditional fixed-effects (FE) model
        xtlogit depvar [indepvars] [if] [in] [weight] , fe [FE_options]
    Population-averaged (PA) model
        xtlogit depvar [indepvars] [if] [in] [weight] , pa [PA_options]


Examples
    Setup
        . webuse union
    Random-effects logit model
        . xtlogit union age grade i.not_smsa south##c.year


    Equal-correlation population-averaged logit model
        . xtlogit union age grade i.not_smsa south##c.year, pa


    Population-averaged logit model with robust variance
        . xtlogit union age grade i.not_smsa south##c.year, pa vce(robust)


    Fixed-effects logit model
        . xtlogit union age grade i.not_smsa south##c.year, fe




Stored results


      xtlogit, fe stores the following in e():
    Scalars        
      e(N)                number of observations
      e(N_g)              number of groups
      e(N_drop)           number of observations dropped because of all positive or all negative outcomes
      e(N_group_drop)     number of groups dropped because of all positive or all negative outcomes
      e(k)                number of parameters
      e(k_eq)             number of equations in e(b)
      e(k_eq_model)       number of equations in overall model test
      e(k_dv)             number of dependent variables
      e(df_m)             model degrees of freedom
      e(r2_p)             pseudo R-squared
      e(ll)               log likelihood
      e(ll_0)             log likelihood, constant-only model
      e(chi2)             chi-squared
      e(g_min)            smallest group size
      e(g_avg)            average group size
      e(g_max)            largest group size
      e(p)                significance
      e(rank)             rank of e(V)
      e(ic)               number of iterations
      e(rc)               return code
      e(converged)        1 if converged, 0 otherwise


    Macros         
      e(cmd)              clogit
      e(cmd2)             xtlogit
      e(cmdline)          command as typed
      e(depvar)           name of dependent variable
      e(ivar)             variable denoting groups
      e(model)            fe
      e(wtype)            weight type
      e(wexp)             weight expression
      e(title)            title in estimation output
      e(offset)           linear offset variable
      e(chi2type)         LR; type of model chi-squared test
      e(vce)              vcetype specified in vce()
      e(vcetype)          title used to label Std. Err.
      e(group)            name of group() variable
      e(multiple)         multiple if multiple positive outcomes within groups
      e(opt)              type of optimization
      e(which)            max or min; whether optimizer is to perform maximization or minimization
      e(ml_method)        type of ml method
      e(user)             name of likelihood-evaluator program
      e(technique)        maximization technique
      e(properties)       b V
      e(predict)          program used to implement predict
      e(marginsok)        predictions allowed by margins
      e(marginsnotok)     predictions disallowed by margins
      e(asbalanced)       factor variables fvset as asbalanced
      e(asobserved)       factor variables fvset as asobserved


    Matrices      
      e(b)                coefficient vector
      e(Cns)              constraints matrix
      e(ilog)             iteration log
      e(gradient)         gradient vector
      e(V)                variance-covariance matrix of the estimators


    Functions      
      e(sample)           marks estimation sample


    xtlogit, pa stores the following in e():
    Scalars        
      e(N)                number of observations
      e(N_g)              number of groups
      e(df_m)             model degrees of freedom
      e(chi2)             chi-squared
      e(p)                significance
      e(df_pear)          degrees of freedom for Pearson chi-squared
      e(chi2_dev)         chi-squared test of deviance
      e(chi2_dis)         chi-squared test of deviance dispersion
      e(deviance)         deviance
      e(dispers)          deviance dispersion
      e(phi)              scale parameter
      e(g_min)            smallest group size
      e(g_avg)            average group size
      e(g_max)            largest group size
      e(rank)             rank of e(V)
      e(tol)              target tolerance
      e(dif)              achieved tolerance
      e(rc)               return code


    Macros         
      e(cmd)              xtgee
      e(cmd2)             xtlogit
      e(cmdline)          command as typed
      e(depvar)           name of dependent variable
      e(ivar)             variable denoting groups
      e(tvar)             variable denoting time within groups
      e(model)            pa
      e(family)           binomial
      e(link)             logit; link function
      e(corr)             correlation structure
      e(scale)            x2, dev, phi, or #; scale parameter
      e(wtype)            weight type
      e(wexp)             weight expression
      e(offset)           linear offset variable
      e(chi2type)         Wald; type of model chi-squared test
      e(vce)              vcetype specified in vce()
      e(vcetype)          title used to label Std. Err.
      e(nmp)              nmp, if specified
      e(properties)       b V
      e(predict)          program used to implement predict
      e(marginsnotok)     predictions disallowed by margins
      e(asbalanced)       factor variables fvset as asbalanced
      e(asobserved)       factor variables fvset as asobserved


    Matrices      
      e(b)                coefficient vector
      e(R)                estimated working correlation matrix
      e(V)                variance-covariance matrix of the estimators


    Functions      
      e(sample)           marks estimation sample


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

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