search for: kidiq

Displaying 1 result from an estimated 1 matches for "kidiq".

2012 Jan 13
1
loops over regression models
...dependent variables. I have been using Stata for quite a while, and I know I can use foreach to build a loop to condense the codes (especially if I have a large number of models to run). In Stata, it would be something like: **************************************************** // read in data use kidiq, clear // run two regression reg kid_score mom_hs reg kid_score mom_iq // the next three lines are equivalent of the previous two lines foreach var in mom_hs mom_iq { reg kid_score `var' } *************************************************** So I want to figure out how to use R to do this....