I have 4 different variable names that I want to collapse to a single column, though keep the identifying variable the same for the other variables.
Data Currently looks like this:
ID var1 var2 var3 var4
1 a1 a2 a3 a4
2 b1 b2 b3 b4
3 c1 c2 c3 c4
And I want to make it look like this:
ID newvar
1 a1
1 a2
1 a3
1 a4
2 b1
2 b2
2 b3
2 b4
3 c1
3 c2
3 c3
3 c4
THanks!
Related Posts with Appending Columns
Accessing estadd ysumm estimates from .ster file and exporting to excelHello! I am attempting to access the regression estimates I have stored in a stata .ster file and ex…
generate a dummy varaible based on whetehr the other dummy has the same or more ==1 than ==0 over the sample periodHello I have a panel data with firm and year variables. I also have a dummy variable, litigation, w…
Problems with merge commandHi! I have a cross-sectional time-series dataset and would like to add some firm-specific informati…
Random sampling according to group in StataHi everyone, I have a question about how to randomly sample data in Stata according to specific gro…
Comparing means of subgroupsHi all, I am trying to build logits to measure gender employment gaps among lone parents in Canada …
Subscribe to:
Post Comments (Atom)
0 Response to Appending Columns
Post a Comment