Hello
I am using the loop function for some simple merges of 5 datasets.
I did it before and it worked. now to redo it again I faced with" too many variables defined" error. Does anyone help me?
my syntax is:
forvalues loop=2002/2016{
clear
use "\\...................\F`loop'.dta",
gen local z=`loop'-1
merge 1:1 Id using "\\..................\G`z'.dta"
keep if _merge==3
drop _merge
save "\\...........................\Cohort`z'.dta", replace
}
Related Posts with Too many variables in loop
Conducting system GMM using xtabond2Dear Stata users, I am using the System GMM approach for estimation and I want to know whether the …
what does the size() option on bootstrap do?I apparently do not understand the documentation for the bootstrap command. Code: . sysuse auto, cl…
How to overcome the word limitation of 12 in Stata output table when using esttab?I remember somewhere that the word limitation for variable name in Stata is 12, and I try with estta…
coefplot and axis labels of different colorsHi all! I am using coefplot to plot predicted probabilities at certain values for 5 model specifica…
Testing for serial correlation in panel analysis with instrumentDear all, Is there an alternative way to test for serial-/autocorrelation in a panel data setting w…
Subscribe to:
Post Comments (Atom)
0 Response to Too many variables in loop
Post a Comment