Merging cross sectional data
Posted: Mon May 04, 2015 6:24 am
I would be most grateful for some help on merging cross sectional data.
I want to merge 4 data sets for the years 2011-2014, for a pooled regression. The datasets are each in a respective page in a wf. The problem is that if I use the copy command to merge the four years the observations gets replaced, as oppose to the "lenghtening" of the series that I want. The variables/objects have the same names each year, and are identified by and id variable (simple, running from 1 - to whatever lenght of the series). So far:
%wf = "path\wfallblu.wf1"
%wf2011= %wf + "\2011"
%wf2012= %wf + "\2012"
%wf2013= %wf + "\2013"
%wf2014= %wf + "\2014"
wfcreate(wf=reg, page=pool) u 84072 '(the total number of observations i each serie if all year where to be added)
wfopen %wf
for !j=1 to 4
pageselect 201{!j}
copy(c=l) * reg::pool\*
next
Anyone have a solution to this? One thing I thought of is creating new id series running from 1 to 84072, but I'm not sure how to create a series like this. A solution to that would be highly appreciated as well.
Best,
Matt
I want to merge 4 data sets for the years 2011-2014, for a pooled regression. The datasets are each in a respective page in a wf. The problem is that if I use the copy command to merge the four years the observations gets replaced, as oppose to the "lenghtening" of the series that I want. The variables/objects have the same names each year, and are identified by and id variable (simple, running from 1 - to whatever lenght of the series). So far:
%wf = "path\wfallblu.wf1"
%wf2011= %wf + "\2011"
%wf2012= %wf + "\2012"
%wf2013= %wf + "\2013"
%wf2014= %wf + "\2014"
wfcreate(wf=reg, page=pool) u 84072 '(the total number of observations i each serie if all year where to be added)
wfopen %wf
for !j=1 to 4
pageselect 201{!j}
copy(c=l) * reg::pool\*
next
Anyone have a solution to this? One thing I thought of is creating new id series running from 1 to 84072, but I'm not sure how to create a series like this. A solution to that would be highly appreciated as well.
Best,
Matt