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
Generate lagged value for psudo panelHi all, I have a data looks as below: Code: * Example generated by -dataex-. To install: ssc inst…
Interval Scaled Independent VariablesHello everyone, I know, this is not a question referring to Stata directly, but maybe someone can h…
Testing for Normality using Jarque-Bera in Panel Data (xtsktest + jb)Dear Stata community, currently, I am trying to decide whether my data is normally distributed or n…
scatter plotshey there! im using stata 14 and want to create the scatter plots between the K (cutt-offs) and H,A,…
Dropping observations based on certain criteriaHello all, Here is a snippet of the data I am working with: Code: * Example generated by -dataex-…
Subscribe to:
Post Comments (Atom)
0 Response to Loop for many, same regressions with similar names
Post a Comment