I want to create a loop to append multiple waves of panel data. Most vars appear in each wave, three additional vars only appear in 4 waves. Should I therefore create two separate loops to append the waves?
I understand when appending waves the vars names need to be the same. In the panel data I have, a prefix is added to each varname to reflect the wave (age in wave 1 is aage, year 2 is bage, year 3 is cage), and for appending the vars need to have the same name. So can we code the removal this prefix within the loop to append the waves? And if not, how would I go about coding this?
Using the source datafile I save the renaming vars to a temp datafile, then save the appending to a new datafile, right? Some clarity in the code on this would be appreciated.
Thank you in advance.
Related Posts with Using a loop to append multiple waves of data
Calculate export times using custom data HTML Code: clear input str10 company_name str3 country int year "3Mcompany" "USA" 2002 "3Mcompany"…
A function for a numberHi, I am writing a loop that looks like this foreach code of numlist 1/202{ forvalues i=1940/2020{ …
Reshape long 1 row dataset with no identifierHi, I am trying to reshape long the following dataset: Code: * Example generated by -dataex-. To i…
Export covariance matrix to ExcelHi, I would like to export the following covariance matrix to excel: Code: * Example generated by…
Need help for displaying bar labels for mean values using <cibar>Hi all, I am working on a replication assignment and I am using the ssc package cibar to to generat…
Subscribe to:
Post Comments (Atom)
0 Response to Using a loop to append multiple waves of data
Post a Comment