Hi
I am trying to predict the residual after regression. But the predicted residual from the previous regression is not clearing from the memory, and it shows an error that the variable is already defined. Even though I dropped the variable and cleared the estimates and results. Below is the codes:
Error:
(51,222 missing values generated)
variable AQ already defined
r(110);
I am trying to predict the residual after regression. But the predicted residual from the previous regression is not clearing from the memory, and it shows an error that the variable is already defined. Even though I dropped the variable and cleared the estimates and results. Below is the codes:
Code:
clear results estimate clear ereturn list levelsof Fama_French, local(industries) foreach Fama_French of local industries { qui levelsof year if Fama_French == `Fama_French', local(years) foreach year of local years { qui count if Fama_French == `Fama_French' & year == `year' local obs = r(N) if `obs' >= 20 { qui reg TCA_W CFOt_1_W CFOt_W CFOt1_W C_Rev_W PPE_W if Fama_French == `Fama_French' & year == `year', robust predict double AQ, residuals } } }
Error:
(51,222 missing values generated)
variable AQ already defined
r(110);
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(PPE_W CFOt_W CFOt1_W CFOt_1_W TCA_W C_Rev_W) -5.21567 -1.5112712 -1.0715939 . . . -2.65431 -.4415217 -.3830536 -.6226791 .019210204 -1.7223364 25.682127 3.207224 5.545249 3.6967645 3.083213 10.168536 -24.948883 -5.204473 -4.466454 -3.010128 -.3389456 -2.9585304 2.447334 .4084733 -.12563916 .47596785 .1154127 -.3859752 19.026062 -1.1796982 .8806584 3.835391 -3.8107 -12.090535 -23.5871 -1.0354838 -.7032258 1.3870968 1.016129 -2.2032259 -75.281555 -2.1165047 -6.242719 -3.116505 -1.961165 -10.194175 141.6 17.146667 17.973333 5.813333 8.853333 -5.146667 -2.0669277 -.23994306 .12851548 -.2289071 .016375937 -1.0804557 2.535138 -.13387725 .39013535 .24995366 .3371037 .13906917 -37.444443 -6.152047 -4.3976607 2.111111 6.122808 25.608187 . . . . . . -42.65585 -21.44781 -22.02254 . . . -5.178624 -2.5783305 -2.677302 -2.511043 .8482286 -1.0590719 1.5590916 .7671875 .27378368 .7388269 .3937432 .0842314 15.33969 3.9618595 4.3802147 11.10179 -.22992358 -21.484995 305.26315 58.81108 60.55072 59.65454 -38.67117 -51.45112 -2.1688414 -.51948506 -.5609948 -.6436641 .3511691 -.027673176 -1.0486771 -.27162483 -.4723541 -.25152645 .0234905 -.03799186 3.363446 1.2272778 1.388124 .7057398 -.06147406 1.4403437 -43.9944 -17.647058 -17.187675 -15.60224 1.5658263 -8.929972 -7.609097 -2.6329114 -3.3902595 -2.7032826 -.27633554 -.56897664 -15.02568 -5.967523 -7.955438 -4.634441 .3549849 -2.0422962 54.13456 27.79156 25.279684 20.846966 .46701846 22.34037 . . . . . . 1.1264602 -.29258355 -.1764466 . . . . . . . . . .1788618 -2.3252032 -9.300813 . . . .52380955 -27.238096 -24.66667 -6.809524 16.190477 -19.809525 -.24175824 11.384616 24.1978 12.57143 1.7142856 0 0 -7.339999 -.6333333 -3.453333 -1.9866667 0 0 -68 -66.217766 -68.180984 -38.67117 0 0 14.328358 20.32836 2.835821 1.8805977 0 0 14.967033 5.362638 10.54945 -5.186813 0 0 .13326052 1.0322229 .3719279 .13489898 0 0 -1.8243243 -1.2760618 -.23552124 .6544401 0 0 -2.443623 -2 -3.4935305 .8724584 0 0 -5.303922 -6.970589 -6.480392 .3627448 0 0 -10.304348 -6.014493 -7.84058 -1.0289855 0 . . . . . . -.3369334 .388378 -.3517678 . . . 2.792249 2.2669358 2.1427534 -2.502866 .4744449 10.625272 -1.471801 -1.098882 -1.9653003 -1.1625673 -.59354043 -2.646791 -.25779983 -.3283341 -.3466663 -.18358538 -.09265739 -.7651396 -1.9002293 -2.2997704 -.7657641 -2.1781552 -1.5053694 -.9627352 -.7845659 -.3271508 -1.2481766 -.9825112 -1.4983138 -1.441926 -.0832638 -.12798774 -.1791973 -.03354597 -.1030826 -.04653332 .15898304 .3287125 .7508897 .23477563 .1505526 .5885359 . . . . . . 6.365853 -1.386418 -.5251076 . . . .5241773 -.1843519 -.6279382 -.4867361 . -.27132306 1.7057302 -.9217499 -1.2362292 -.27061 . -.109427 7.183027 -5.128834 -1.311861 -3.824131 . -.4662577 5.925688 -1.1770642 -.5844037 -4.6018343 . -.4082569 10.23632 -1.0103093 2.0919905 -2.0348928 . -1.9746233 2.184144 .444033 -1.0728834 -.214442 . .12859789 2.387061 -1.1714759 .25877595 .48483735 . -.19775777 5.517797 .5966102 -1.1093221 -2.7008476 . -.8050848 16.789133 -3.3868046 -.5743855 1.8214748 . 3.249677 -18.254496 .6141079 .6556017 3.621024 . 2.724758 1.8374982 -.06617339 -.55172414 -.0619852 . .0795756 . . . . . . -4.0783553 .4024109 -.7314306 . . . -1.6217674 -.32730445 .2019673 .180073 -.50071394 -1.61082 -86.59761 10.143427 -51.59363 -16.438248 -38.67117 -51.45112 -2.735061 -1.1532638 -.8280346 .22673434 .2605753 -.92742 -14.793185 -4.4003787 -1.0222434 -6.128727 -4.1609087 -16.701374 -3.0228276 -.20291217 -1.6640676 -.8734617 -1.0164396 -.4866134 -1.7216733 -.781592 -.4245499 -.09530534 -.12883869 -1.3026828 10.36855 1.8317152 1.7037884 3.3721685 1.9920044 2.2752714 -46.87265 -7.036164 -23.11635 -7.564466 -5.536163 -10.646227 -3.5167906 -1.538027 -.5984936 -.4681452 .4634376 -.5372947 -5.711639 -.7852045 -.7055998 -2.0178425 -1.29042 -2.957178 -4.825659 -.5156987 -.2900993 -.57387906 -1.1099408 -1.8141237 . . . . . . -3.6560776 -.9525505 -1.439737 . . . -8.659256 -2.7453825 -2.680406 -1.8163843 -.04225166 -49.30666 -13.79343 -3.8133025 -3.077289 -3.9057415 .03988668 -11.655645 3.96079 .8199277 .8787896 1.0160346 .14157064 10.534456 4.4662547 .9658501 .522075 .9011568 -.3416019 3.829076 -116.618 -13.933278 -3.797648 -25.776865 -1.2605968 47.1314 -10.641214 -.3875865 -1.456575 -1.422025 -.8170909 47.1314 65.87167 13.612937 16.178404 3.6223264 -6.296296 47.1314 -5.366004 -1.193489 -1.8047794 -1.0042331 .6500424 -16.476295 10.031454 2.7066224 -2.5392585 1.7898717 -.6329824 3.522378 -5.021983 1.1207652 -2.063936 -1.1946355 -1.5452136 20.093357 -43.73012 -17.137478 -2.913917 9.306048 9.437182 -51.45112 . . . . . . 3.390832 -2.1073005 -.09643464 . . . -4.929484 .13440607 -4.357785 2.937056 -1.968765 1.751065 -177.2381 -68 -63.1746 4.5079365 -9.523816 -51.45112 -3.9811 -1.3432332 -2.680391 -3.107661 -.43536955 .3732703 -5.346325 -3.224523 2.3840845 -1.6159155 .17702003 -3.205846 -4.880775 1.8972536 -6.927948 -2.5660744 -1.1121162 .8071082 -69.57198 -68 17.789883 22.84825 36.183453 -51.45112 5.203324 -1.266482 2.92964 5.939612 3.894737 -6.257064 17.21183 8.454037 -3.97442 -3.654676 -15.69944 15.963228 71.32001 -11.04889 19.75111 23.502224 2.560001 -41.24445 -2.417216 -.6892594 .9774331 .3855758 .21015897 -.6264443 end
Comment