I have the following data set and want to order the variables by the variables with the least missing. I then want to complete a stepwise regression adding the variables (in that order) with anything with a t stat of <0.2 remaining plus also a mean vif of <1.5.
I can't manage to include the mean vif and I can't get the stepwise to regress in the order of the variable with the least missing first either. The dependent variable is the WeekPriceChangePercent.
Giles
My effort
Please can you help me?
I can't manage to include the mean vif and I can't get the stepwise to regress in the order of the variable with the least missing first either. The dependent variable is the WeekPriceChangePercent.
Giles
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double(WeekPriceChangePercent PricetoBookValueMRQ PricetoEarningsRatio Beta5year BookValueperShareMRFY CashperShareTTM CurrentRatio CapExGrowthRate5Year) .1366 2.84 17.31 1.59 4.33 .0088 2.15 .1439 0 2.36 22.51 .2313 23.1 .0336 2.73 .298 .4236 11.1 114.09 -.8464 5.56 .0173 21.44 1.1844 -.1139 4.44 22.05 -.0624 1.21 .0032 1.16 -.1491 -.176 1.34 18.35 .3799 13.11 .0119 . -.0331 .2263 1.09 . 1.49 8.37 .0031 1.1 .1901 2.9762 12.27 . 3.09 .2683 -.0014 5.7 -.0153 .0322 1.66 22.55 .4906 14.38 .0216 2.04 .0359 1.0394 9.78 . -.168 4.14 -.0032 3.49 .3163 .3832 9.94 . 1.56 1.09 -.008 4.09 -.238 .2045 1.14 3.94 .2252 .7341 .001 4.56 . -.1926 .8963 11.31 1.06 .3949 .0005 3.53 . -.285 2.06 . 1.61 5.54 -.0523 2.63 .4073 .3249 1.46 7.41 1.59 8.24 . 4.15 -.1294 .3778 11.99 27.29 1.06 17.26 .1034 2.07 .0059 .4126 6.35 . 1.44 .1962 .0005 .3203 .4519 1.2924 5.42 46.34 . .3966 .0004 1.45 .5458 -.5089 2.97 . -.0126 1.83 -.0017 8.44 . .0659 25.85 26.82 .8692 1.04 .0088 1.44 .0269 .648 1.99 19.95 .4067 .7695 -.0028 2.41 . .4341 1.99 19.95 .4067 .7695 -.0028 2.41 . .0866 .4649 13.44 1.35 41.43 .0194 . .0731 -.0049 1.36 15.06 . 1.4 .0045 1.32 -.0011 .2855 14.98 129.42 1.4 .3324 .0011 .7228 .1564 -.029 4.61 35.3 . 2.5 .0004 3.26 . -.0097 4.57 . .5491 2.3 .0005 3.94 .4425 .0967 1.09 10.95 .7033 4.69 .004 .5064 . .0732 1.09 10.95 .7033 4.69 .004 .5064 . -.1144 3.96 18.57 .8304 4.68 . .1066 . .8008 1.2 17.52 .9103 4.69 .006 1.31 .0935 .2911 4.21 21.95 .6062 1.56 .004 1.35 .1232 -.0965 5.96 . 1.06 .9236 -.0021 2.06 .0614 2.3113 23.15 62.61 .9738 .1755 .0002 2.52 -.2459 .1956 1.68 35.59 1.01 .7783 .0012 1.37 .0733 .1828 .8827 54.96 1.22 .0666 0 5.44 -.2133 -.422 . 9.69 .7371 -3.14 .0025 .6413 .217 -.3402 . 9.69 .7371 -3.14 .0025 .6413 .217 .1588 1.31 . . 5.27 .0034 3.28 . .9641 . 29.74 .0775 1.3 . . .2633 .7186 . 29.74 .0775 1.3 . . .2633 -.1418 .6537 32.62 . .163 0 7.21 . . .6537 32.62 . .163 0 7.21 . .21 4.23 27.59 1.3 16.1 .0312 1.97 .2279 .2118 4.23 27.59 1.3 16.1 .0312 1.97 .2279 .4597 3.53 25.48 .943 11.02 .0241 1.28 .0651 .5766 3.53 25.48 .943 11.02 .0241 1.28 .0651 . 3.53 25.48 .943 11.02 .0241 1.28 .0651 .1269 1.93 16.2 1.16 53.35 .1245 .9645 -.0009 .3069 1.6 91.29 1.41 19.38 .0198 2.65 -.181 .2691 1.85 21.72 .2069 15.1 .1501 . -.0598 .1162 1.85 21.72 .2069 15.1 .1501 . -.0598 .609 6.07 44.04 .8098 1.48 .0024 3.42 1.0824 -.1408 .7159 7.27 .8573 8.73 .0104 1.58 -.0028 -.32 17.41 . 1.68 -.1083 -.007 3.32 .0389 -.3438 17.41 . 1.68 -.1083 -.007 3.32 .0389 .1207 3.27 19.19 1.02 5.17 .0127 2.32 .0276 .1223 3.27 19.19 1.02 5.17 .0127 2.32 .0276 .278 1.23 7.54 .6028 1.77 .002 4.12 -.0221 .0984 5.11 52.17 1.02 8.6 .0133 6.34 .0583 .2619 4.21 26.8 1.06 4.56 .0098 1.37 -.0403 .1431 4.17 26.53 1.14 4.56 .0098 1.37 -.0403 .2128 4.17 26.53 1.14 4.56 .0098 1.37 -.0403 .1193 1.02 6.02 .3617 12.77 .0213 4.29 .07 .445 3.2 48.51 1.53 10.16 .0117 2.69 -.0554 .6374 23.95 24.37 1.52 2.12 .0321 1.45 .0614 -.0238 2.44 15.47 .1461 2.45 .0048 8.23 . .063 2.4 19.59 .4256 17.44 .0262 5.57 -.0223 .3958 7.44 53.91 .7319 1.5 .0024 4.4 .466 .9073 4.91 24.64 . 8.53 .0093 1.44 . 1.9346 7.15 . 1.28 1.79 -.0036 22.13 .6696 .6159 1.12 . .9933 13.37 .0231 2.08 -.1506 .3949 3.52 20.87 .6387 3.49 -.0021 1.1 .1646 .1768 3.72 12.36 .4359 .1745 .0003 1.25 -.3412 -.0241 3.72 12.36 .4359 .1745 .0003 1.25 -.3412 . 8.82 . . 3.15 . 1.01 . .4141 4.4 21.87 .8585 7.92 .0168 3.3 1.1912 . 1.1 7.52 . .0467 . 2.73 . 1.978 27.72 . 1.94 1.5 -.0024 4.09 .0348 -.0226 1.85 27.96 .7637 15.3 .0153 1.63 .1536 -.1401 1.85 27.96 .7637 15.3 .0153 1.63 .1536 .2851 1.26 11.72 . 17.88 .0079 . . .2728 1.26 11.72 . 17.88 .0079 . . -.2609 . . .5346 0 . 1 . -.0238 5.31 20 . 1.71 .0014 2.79 .1994 .0266 . . .7984 -.9886 .0036 .6058 .283 -.5283 . 8.53 .4657 3.31 .0007 . -.0665 -.5378 . 8.53 .4657 3.31 .0007 . -.0665 -.2115 1.36 35.45 .5598 13.84 .0169 . .4084 .0946 1.21 14.8 .3462 9.36 .008 2.21 .4445 .0511 2.7 17.55 .827 .9977 .0016 1.15 .0843 .3111 .7359 12.07 .365 1.03 .0038 3.24 -.1375 .2941 .7359 12.07 .365 1.03 .0038 3.24 -.1375 -.4444 .6802 . . -.3647 . .9193 . .0644 11.66 . 2.17 1.1 -.0089 21.23 . .1563 1.96 25.66 .8887 10.97 .0157 1.77 .1089 .1561 1.96 25.66 .8887 10.97 .0157 1.77 .1089 -.3759 1.31 16.44 1.05 .3991 .0005 1.43 .5511 -.0617 1.41 18.44 .6746 4.85 -.0012 3.03 . .3829 11.17 28.37 1.03 10.25 .0577 1.25 .0676 .7031 1.64 73.76 1.38 4.96 .0002 22.69 .2771 end
Code:
preserve drop WeekPriceChangePercent misstable tree, asis return list restore display r(vars) order `r(vars)' local z WeekPriceChangePercent stepwise, pe(0.2): regress `z' `r(vars)'
Comment