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
Exporting regression tables after -estat impact-Dear Statalist, I am using the -spxtregress- command in Stata 15 for spatial data analysis. To get …
Firm and year fixed effects with two way clustering- Is this command correct?I have an unbalanced data of 3000 firms over 30 years. I am trying to run a regression with firm and…
Speed up Rangestat and asrolHi Statalists, I have two datasets to calculate 2 variables: Roll (1984) liquidity measure and the …
Working directory with spacesI am using the cd command (cd "C:\Users\Arbnor Gashi\Desktop\Stata new 2018\Lessons and practice") t…
How do I construct probit models from panel dataI have a bunch of health metrics that needs to be regressed on each other in a probit model: Code…
Subscribe to:
Post Comments (Atom)
0 Response to Too many variables in loop
Post a Comment