Hi there,
I have a number of files named filename1990.dta, filename1991.dta etc until 2018. I would like to write a loop doing two things:
1) append the files, and
2) create a variable 'year' corresponding to the file name (2004, 2005, 2006) to show me which year the data came from.
thanks in advance for your help!
Liza
Related Posts with loop to append multiple files and add new variable
How can determine the best cut point with large number of observationI have data set contains 300 observation and when I am using the Roctab command to calculate sensiti…
Divide population according to predefined predicted probabilities cut-offsDear all, I run a logistic regression model with predictors (age, diabetes, hypertension, tobacco)…
Calculating ratios in panel dataI searched Stata help and this forum but found no solution. I want to calculate some simple ratios o…
Clique identification within larger networkI am interested in identifying cliques of entities (think of groups of common friends within a socia…
Different estimation when using interaction terms compared to manual multiplicationHello, I am getting different results when I use interaction terms with xtreg compared multiplying …
Subscribe to:
Post Comments (Atom)
0 Response to loop to append multiple files and add new variable
Post a Comment