Dear List
i use a short n sweet loop to append a dataset divided by year.
the problem is that at year 1995 one of the variables goes from being str5 to str6 in 1995
for some reason stata then removes all data from before 1995
if I append the years one by one stata manages to 'reformat' the str so the dataset fits and all data is included.
can you see what i am doing wrong?
lars
i use a short n sweet loop to append a dataset divided by year.
the problem is that at year 1995 one of the variables goes from being str5 to str6 in 1995
for some reason stata then removes all data from before 1995
if I append the years one by one stata manages to 'reformat' the str so the dataset fits and all data is included.
Code:
forvalues year =1977(1)2012 { use file_year_`x'.dta if `x' !=1977 append using file_year_`x'.dta save file_all_years.dta, replace }
lars
Comment