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
How can I find out how Stata is calculating covariance matrices exactly(!)I'm trying to translate Stata results into R and with the existing methods, I can only recreate stan…
Violations of the proportional hazards assumptionHello everyone Perform a COX proportional hazard regression model. However, the final multivariate …
How to identify the oldest and youngest children in each HHHi all, I would like to create variables that could identify who is the oldest and youngest childre…
Exporting Regression Results with 6 decimal pointsHello, I can export regression results in stata, but I was wondering how to export regression result…
How to estimate margins after bioprobit?Hello everyone, I am conducting a study to analyze accident data. I have two outcome variables, nam…
Subscribe to:
Post Comments (Atom)
0 Response to Nested forvalue loops - referring to previous macros in a relevant macro
Post a Comment