Good afternoon.
Could anyone help me decipher what syntax error I am producing in the below command sequence?
/*Given*/
regress offspringheight mpheight if(tallmpheight==1), robust
global mp_b = _b[mpheight]
global cons_b = _b[_cons]
global new_meanmpheight1 = 68.78209
/*Then*/
forvalues j = 1(1)100 {
forvalues i = `=`j'+1' {
global new_meanmpheight`i' = $cons_b + ($mp_b * $new_meanmpheight`i')
}
}
That is, I seek to perform multiple regression predictions over successive iterations that require local macro `i' to be defined in term of another local macro `j'. From that I seek to save in STATA's global memory all predictions made on the basis of the orginial regression regress offspringheight mpheight if(tallmpheight==1), robust (In attempt to demonstrate a conversion of heights).
please let me know what mistake I am making in defining the above nested loop.
Related Posts with Nested forvalue loops - referring to previous macros in a relevant macro
foreach loop based on whether variable has certain valuesHello, I am trying to create a loop for a large cross-sectional dataset that identifies string vari…
Panel Data Estimation TechniqueHello Everyone, I am conducting some panel data analysis using fixed effects and system gmm. My tota…
best package for matchingHi stata-users, I have been trying to understand psmatch2 but it hasn't been very helpful. I don't …
Histogram misbehavingI was plotting the simplest of histograms (observations by year) in Stata 14 and finding that the hi…
Multilevel model: how to determine whether there was a statistically significant change over timeHi all, I am running a simple multilevel model to determine whether a group of people had a statist…
Subscribe to:
Post Comments (Atom)
0 Response to Nested forvalue loops - referring to previous macros in a relevant macro
Post a Comment