首页 > 解决方案 > 为什么Stata中的这种回归没有进展也没有返回错误代码?

问题描述

我正在使用以下命令在 Stata 中对多个估算数据运行多级逻辑回归:

xi: mi estimate, cmdok post: melogit outcome i.var1 i.var2 i.var3, difficult || id:

我已经成功地运行了具有相同协变量和不同结果的类似模型。这些模型使用我的数据集只需要 1 到 2 分钟(大约 n=130,000,n=10 插补)。

对于其他结果,即使经过数小时,Stata 也会达到某个点并且正在运行“某事”,但我不确定是什么(即右下角的圆圈在旋转)。我过去常常set trace on检查引擎盖下发生的事情(下面最后大约 100 行输出)。我对马塔不熟悉。Stata 达到了这一点,似乎没有进一步的进展,但没有返回错误代码并停止程序。任何人都可以提出为什么 Stata 正在努力进一步进行回归,或者提出替代方案来避免这个问题?同样的问题发生在amelogitmeglmalink(logit)family(binomial)

    - syntax name(name=maxmin) [, NEGH TOLerance(numlist ma
> x=1 >=0) LTOLerance(numlist max=1 >=0) NONRTOLerance NRTOLerance(numlist max=1 >=0)
>  QTOLerance(numlist max=1 >=0) GTOLerance(numlist max=1 >=0) ITERate(numlist max=1 
> >=0) NOTCONCAVE(numlist max=1 >=0) ndami DIFficult HALFSTEPonly DOOPT SEArch(name) 
> Repeat(passthru) Bounds(string) SCore(string) noWARNing noCLEAR noLOg DOTs SHOWTOLe
> rance SHOWNRtolerance SHOWSTEP TRace COEFDIffs GRADient HESSian noSKIPline noOUTput
>  Level(cilevel) moptobj(string) * ]
                              - if `:length local nrtolerance' {
                              = if 0 {
                                opts_exclusive "nrtolerance() `nonrtolerance'"
                                }
                              - if `:length local qtolerance' {
                              = if 0 {
                                opts_exclusive "qtolerance() `nonrtolerance'"
                                }
                              - opts_exclusive "`nonrtolerance' `shownrtolerance'"
                              = opts_exclusive " "
                                ---------------------------- begin opts_exclusive ---
                                - version 8.2
                                - args opts optname errcode
                                - local opts `opts'
                                = local opts  
                                - local n 0
                                - while `"`opts'"' != "" {
                                = while `""' != "" {
                                  local ++n
                                  gettoken item`n' opts : opts, bind
                                  }
                                - if `n' < 2 {
                                = if 0 < 2 {
                                - exit
                                ------------------------------ end opts_exclusive ---
                              - if `:length local shownrtolerance' {
                              = if 0 {
                                local showtolerance showtolerance
                                }
                              - if "$ML_preserve" != "no" {
                              = if "no" != "no" {
                                if `:length local score' {
                                di as err "May not specify score() option unless" _n 
> "     a)  estimation subsample is the entire data in memory, or" _n "     b)  you s
> pecify nopreserve option on -ml model- statement (meaning" _n "         your evalua
> tion program explicitly restricts itself to obs." _n "         for which $" "ML_sam
> p==1."
                                exit 198
                                }
                                preserve
                                local N = c(N)
                                quietly keep if $ML_sample
                                if (`N' != c(N)) {
                                mata: Mopt_init_regetviews()
                                }
                                }
                              - if `:length local score' {
                              = if 0 {
                                SetupScore `"$ML_evaltype"' `"`score'"' $ML_n $ML_dim
                                local scores "`s(scores)'"
                                }
                              - local tropts `log' `dots' `showtolerance' `showstep' 
> `trace' `coefdiffs'
                              = local tropts      
                              - if "`tropts'" != "nolog" {
                              = if "" != "nolog" {
                              - local tropts `tropts' `gradient' `hessian'
                              = local tropts   
                              - if "`skipline'" == "" {
                              = if "" == "" {
                              - if "`iterate'" != "0" | `:length local tropts' {
                              = if "" != "0" | 0 {
                              - di
                              - }
                              - }
                              - }
                              - else {
                                local gradient
                                local hessian
                                local nolog nolog
                                }
                              - if "`search'" != "off" & "`iterate'" != "0" {
                              = if "off" != "off" & "" != "0" {
                                if "`search'" == "quietly" {
                                local sopts nolog
                                }
                                else {
                                if `:length local tropts' {
                                if "`tropts'" != "nolog" {
                                local sopts trace
                                }
                                else local sopts nolog
                                }
                                }
                                if "`search'" == "norescale" {
                                local sopts `sopts' norescale
                                }
                                Search `bounds', nopreserve `sopts' `repeat' `maxmin'
                                }
                              - tempname value b V iV
                              - `vv' mata: Mopt_maxmin()
                              = version 13: mata: Mopt_maxmin()

标签: statalogistic-regression

解决方案


推荐阅读