Hello, I am trying to run the accruals model found at http://www.statalist.org/forums/foru...=1472789396393 but I am having trouble. For the first set of code, I receive the error message "no observations" after obtaining a few dozen values. For the second set, which includes capture, I get more observations (about 110) but then I receive the error message "no variables defined". Then the final set produces even more observations, but when I check back a few hours later, the code appears to be somehow paused as Stata is no longer producing any new changes to the data, but the gear status wheel is still spinning and I cannot break the code without exiting Stata through task manager. I am not sure how to get this code to run correctly after these three attempts at achieving accrual glory.
(1)
(2)
(3)
(1)
Code:
gen uhat = . forvalues j = 1/`=_N' { regress totalaccruals assetsinverselag dev ppe if sic_2 == sic_2[`j'] & year == year[`j'], nocons if e(N) >9 { replace uhat=totalaccruals-(_b[assetsinverselag]*assetsinverselag + _b[dev]*dev + _b[ppe]*ppe) in `j' } } }
Code:
gen uhat = . forvalues j = 1/`=_N' { capture regress totalaccruals assetsinverselag dev ppe if sic_2 == sic_2[`j'] & year == year[`j'], nocons if e(N) >9 { replace uhat=totalaccruals-(_b[assetsinverselag]*assetsinverselag + _b[dev]*dev + _b[ppe]*ppe) in `j' } } }
Code:
gen uhat = . forvalues j = 1/`=_N' { capture regress totalaccruals assetsinverselag dev ppe if sic_2 == sic_2[`j'] & year == year[`j'], nocons if !_rc & e(N) >9 { replace uhat=totalaccruals-(_b[assetsinverselag]*assetsinverselag + _b[dev]*dev + _b[ppe]*ppe) in `j' } } }