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
how to use Stata 17 to output a table of panel fixed effects regression?Dear Statalist, I am using Stata 17 to run panel fixed effects regression.I want to use the command…
McNemar's test after Propensity Score Matching?Dear all, Apologies I am asking a very basic question as I am having trouble with it. For instance …
Visualizing on different conditionsHi all, I am trying to plot a scatter diagram based on different conditions but it does not work. …
Panal data regression with vce robustHi, I'm want run a regression analysis on panel data from a time period 1997-2015. I ran the follow…
Issue with an -estadd- to display fixed effectsI would like to display two fixed effects at the end of each column: "FE(i): yes" and "FE(y): yes". …
Subscribe to:
Post Comments (Atom)
0 Response to Too many variables in loop
Post a Comment