Hello Everyone,
I have a large dataset - panel data with 156,790 observations. After running a Weibull distribution model, the result table reveals all predictor variables are significant. Correlation tests show that this is not due to multicollinearity. Therefore, I used the domme command to conduct dominance analysis to determine the relative importance of the predictors within the model. However, I receive the following error message: variable _cons not found.
Joseph Luchman, who wrote the domme command has looked at my syntax and believes the code looks reasonable to him given the model I presented, but he is not sure why I am getting such an error message. He suggested that the error message may have something to do with the frequency weights I use. I applied the weights since otherwise, Stata cannot run the Weibull model.
Does anyone know what the issue is and how I might resolve it?
I have included sample data below as well as my commands for the Weibull regression and the domme command.
Any insights would be greatly appreciated.
Below are the Weibull regression results.
This is the command syntax I use to determine relative importance.
Then I receive the following error.
I have a large dataset - panel data with 156,790 observations. After running a Weibull distribution model, the result table reveals all predictor variables are significant. Correlation tests show that this is not due to multicollinearity. Therefore, I used the domme command to conduct dominance analysis to determine the relative importance of the predictors within the model. However, I receive the following error message: variable _cons not found.
Joseph Luchman, who wrote the domme command has looked at my syntax and believes the code looks reasonable to him given the model I presented, but he is not sure why I am getting such an error message. He suggested that the error message may have something to do with the frequency weights I use. I applied the weights since otherwise, Stata cannot run the Weibull model.
Does anyone know what the issue is and how I might resolve it?
I have included sample data below as well as my commands for the Weibull regression and the domme command.
Any insights would be greatly appreciated.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float use_of_force double total_legitimacy byte leadership_power float capability_preponderance byte system_effects_isolation double core_interests_weighted 1 .095 1 0 0 1.3 1 .095 1 0 0 1.3 1 .095 1 0 0 . 1 .095 1 0 0 . 1 .095 1 0 0 1.9 1 .095 1 0 0 1.9 1 .095 1 0 0 1.3 1 .095 1 0 0 1.3 1 .095 1 0 0 . 1 .095 1 0 0 . 1 .095 1 0 0 1.9 1 .095 1 0 0 1.9 0 .155 2 0 0 1 1 .155 2 0 0 1 1 .155 2 0 0 1 1 .155 2 0 0 1 0 .155 2 0 0 1 1 .155 2 0 0 1 1 .155 2 0 0 1 1 .155 2 0 0 1 1 .155 2 0 0 1 1 .155 2 0 0 1 1 .155 2 0 0 1 1 .155 2 0 0 1 1 .155 2 0 0 1 1 .155 2 0 0 1 1 .155 2 0 0 .8 0 .155 2 0 0 .8 1 .155 2 0 0 .8 1 .155 2 0 0 .8 1 .155 2 0 0 .8 1 .155 2 0 0 .8 1 .155 2 0 0 .8 1 .155 2 0 0 .8 1 .155 2 0 0 .8 1 .155 2 0 0 .8 1 .155 2 0 0 .8 1 .155 2 0 0 .8 1 .155 2 0 0 .8 0 .155 2 0 0 .8 1 .155 2 0 0 1 1 .155 2 0 0 1 0 .155 2 0 0 1 0 .155 2 0 0 1 1 .155 2 0 0 1 1 .155 2 0 0 1 1 .155 2 0 0 1 1 .155 2 0 0 1 1 .155 2 0 0 1 1 .155 2 0 0 1 1 .155 2 0 0 1 1 .155 2 0 0 1 1 .155 2 0 0 1 1 .155 2 0 0 1 1 .155 2 0 0 1.5 1 .155 2 0 0 1.5 1 .155 2 0 0 1.5 1 .155 2 0 0 1.5 1 .155 2 0 0 1.5 0 .155 2 0 0 1.5 1 .155 2 0 0 1.5 1 .155 2 0 0 1.5 1 .155 2 0 0 1.5 1 .155 2 0 0 1.5 1 .155 2 0 0 1.5 1 .155 2 0 0 1.5 1 .155 2 0 0 1.5 0 .155 2 0 0 1.5 1 .17 3 0 0 1.2 1 .17 3 0 0 1.2 1 .17 3 0 0 1.2 1 .17 3 0 0 1.2 1 .17 3 0 0 1.2 1 .17 3 0 0 1.2 1 .17 3 0 0 1.2 1 .17 3 0 0 .8 1 .17 3 0 0 .8 1 .17 3 0 0 .8 1 .17 3 0 0 .8 1 .17 3 0 0 .8 1 .17 3 0 0 .8 1 .17 3 0 0 .8 1 .17 3 0 0 .8 1 .17 3 0 0 .8 1 .17 3 0 0 .8 1 .17 3 0 0 .8 1 .17 3 0 0 .8 1 .17 3 0 0 .8 1 .17 3 0 0 .8 1 .17 3 0 0 1.2 1 .17 3 0 0 1.2 1 .17 3 0 0 1.2 1 .17 3 0 0 1.2 1 .17 3 0 0 1.2 1 .17 3 0 0 1.2 1 .17 3 0 0 1.2 1 .24 4 0 0 1 1 3.1641596638655467 5 0 0 0 1 3.1641596638655467 5 0 0 0 1 3.1641596638655467 5 0 0 0 end
Code:
. do "C:\Users\Sunyoung\AppData\Local\Temp\STD2a90_000000.tmp"
. tsset group_id seqnum
panel variable: group_id (unbalanced)
time variable: seqnum, 1 to 29318
delta: 1 unit
. tsspell event_use_of_force
.
. global time _seq
. global event event_use_of_force
. global xlist total_legitimacy leadership_power i.capability_preponderance i.system_effects_isolation core_interests_weighte
> d
.
. xtset $event_use_of_force
panel variable: group_id (unbalanced)
time variable: seqnum, 1 to 29318
delta: 1 unit
. stset $time, failure ($event)
failure event: event_use_of_force != 0 & event_use_of_force < .
obs. time interval: (0, _seq]
exit on or before: failure
------------------------------------------------------------------------------
156,790 total observations
0 exclusions
------------------------------------------------------------------------------
156,790 observations remaining, representing
74,657 failures in single-record/single-failure data
13115330 total analysis time at risk and under observation
at risk from t = 0
earliest observed entry t = 0
last observed exit t = 4,918
.
. * When running xtstreg, recieved error message (r1400) "initial values not feasible". numerical overflow - You have attempt
> ed something that, in the midst of the necessary calculations, has resulted in something too large for Stata to deal with a
> ccurately. Most commonly, this is an attempt to estimate a model (say, with regress) with too many effective observations.
> This effective number could be reached with far fewer observations if you were running a frequency-weighted model. Stata
> suggests using frequency weights (fweight) to address the issue.
.
. xtstreg $xlist [fweight=use_of_force], dist (weibull)
failure _d: event_use_of_force
analysis time _t: _seq
Fitting comparison model:
Iteration 0: log likelihood = -11456980
Iteration 1: log likelihood = -212771.72
Iteration 2: log likelihood = -183980.49
Iteration 3: log likelihood = -174021.93
Iteration 4: log likelihood = -173757.77
Iteration 5: log likelihood = -173756.97
Iteration 6: log likelihood = -173756.97
Refining starting values:
Grid node 0: log likelihood = -173202.69
Fitting full model:
Iteration 0: log likelihood = -173202.69 (not concave)
Iteration 1: log likelihood = -173125.16 (not concave)
Iteration 2: log likelihood = -173093.7 (not concave)
Iteration 3: log likelihood = -173064.82 (not concave)
Iteration 4: log likelihood = -173038.99 (not concave)
Iteration 5: log likelihood = -173028.5
Iteration 6: log likelihood = -173004.69
Iteration 7: log likelihood = -172905.78
Iteration 8: log likelihood = -172905.54
Iteration 9: log likelihood = -172905.54
Random-effects Weibull PH regression Number of obs = 72,401
Group variable: group_id Number of groups = 164
Obs per group:
min = 5
avg = 441.5
max = 9,881
Integration method: mvaghermite Integration pts. = 12
Wald chi2(5) = 13080.31
Log likelihood = -172905.54 Prob > chi2 = 0.0000
--------------------------------------------------------------------------------------------
_t | Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval]
---------------------------+----------------------------------------------------------------
total_legitimacy | 1.16034 .0020356 84.77 0.000 1.156357 1.164336
leadership_power | 1.021782 .001048 21.01 0.000 1.01973 1.023838
1.capability_preponderance | 1.97642 .1412776 9.53 0.000 1.718043 2.273655
1.system_effects_isolation | 2.372612 .032856 62.39 0.000 2.309081 2.43789
core_interests_weighted | .9821228 .0095827 -1.85 0.064 .9635194 1.001085
_cons | .0764842 .005695 -34.52 0.000 .0660984 .0885018
---------------------------+----------------------------------------------------------------
/ln_p | -.1140053 .0025787 -.1190593 -.1089512
---------------------------+----------------------------------------------------------------
/sigma2_u | .0505792 .006482 .0393447 .0650216
--------------------------------------------------------------------------------------------
Note: Estimates are transformed only in the first equation.
Note: _cons estimates baseline hazard (conditional on zero random effects).
LR test vs. Weibull model: chibar2(01) = 1702.86 Prob >= chibar2 = 0.0000
.
end of do-file
Code:
domme (_t = total_legitimacy leadership_power 1.capability_preponderance 1.system_effects_isolation core_interests_weighted) [fweight=use_of_force], reg(xtstreg total_legitimacy leadership_power i.capability_preponderance i.system_effects_isolation core_interests_weighted) ropt(distribution(weibull)) fitstat(e(), est)
Code:
. do "C:\Users\Sunyoung\AppData\Local\Temp\STD2a90_000000.tmp" . domme (_t = total_legitimacy leadership_power 1.capability_preponderance 1.system_effects_isolation core_interests_weighted > ) [fweight=use_of_force], reg(xtstreg total_legitimacy leadership_power i.capability_preponderance i.system_effects_isolati > on core_interests_weighted) ropt(distribution(weibull)) fitstat(e(), est) variable _cons not found r(111); end of do-file

Comment