Hello everyone, I am new to Stata and need your help.
I can run the following simple regression with the attached dataset:
clear all
import excel "xyz1.xlsx", firstrow case(lower) clear
gen lxa = ln(20+xa)
reg y lxa za
In the dataset, I have the following variables:
t y xa xb xd xf za zb zd zf
I would like to repeat the regression as follows:
gen lxb = ln(20+xb)
reg y lxb zb
......
gen lxd = ln(20+xd)
reg y lxd zd
......
gen lxf = ln(20+xf)
reg y lxf zf
......
How may I write a loop over 'a', 'b', 'd', 'f' to do the above task?
Thank you very much!!
Related Posts with Loop for many, same regressions with similar names
Error when using generate to copy variableHi, I am failing at a surprisingly simple task. In a csv file I have a date variable (mess_datum) i…
Panel data regressionHello, Greeting to all! Please I am trying to test the consequences of exchange rate regime and capi…
reshaping bilateral dataDear Statalist members, I have an issue to reshape the bilateral exchange rate data, could someone …
Continuous threshold model (Kink threshold model)Hey all, What's the difference between the threshold model that can divide the sample into two regi…
Syntax for By var: with IF statementThis is not a pressing matter as I easily found a work-around, I was just curious if anyone could te…
Subscribe to:
Post Comments (Atom)
0 Response to Loop for many, same regressions with similar names
Post a Comment