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
expand 2x2 table by merging additional variables as columns with tabout or putexcelHi, I have a data that looks like this: Code: * Example generated by -dataex-. To install: ssc in…
PVARSOC error(2001)I work on a PVAR model covering 8 countries with 88 observations. I using stata 15. I'm trying to de…
How to extract a sub stringHi all, I wanted to extract a sub string from a string, The string in my data set is as follows 222…
Python 3.8, error r(7100)I have been trying out the latest release of Python, 3.8.0, but when I try to use it I get the follo…
How to perform a kmeans cluster analysis on variables and not on individualsDear Members, I wish to perform a kmeans factor analysis on the database I briefly described here: …
Subscribe to:
Post Comments (Atom)
0 Response to Nested forvalue loops - referring to previous macros in a relevant macro
Post a Comment