Hello Everyone,
I am using a large survey (non panel) data set and would like to restructure multiple policy position values into one new pooled policy variable while keeping each value separate (not adding the values together). This would mean adding observations, duplicating and keeping constant all other information for each respondent as shown below:
Original Data Example:
ID__Policy1__Policy2__Policy3__X1__X2__X3
1_____A______B______C______1___2___3
2_____B______A______C______3___2___1
Where ID is the respondent's ID, Policy1/2/3 are the different values of policy positions, X1/2/3 are other variables of interest.
Restructured to:
ID__Policy__X1__X2__X3
1____A_____1___2___3
1____B_____1___2___3
1____C_____1___2___3
2____B_____3___2___1
2____A_____3___2___1
2____C_____3___2___1
Where ID is the respondent's ID, Policy is the new singular pooled policy value variable, X1/2/3 are other variables of interest.
I have not used Stata to do this before and I am sure that it is a simple solution, and I am reaching out for advice on what code is needed and any other information that you think I should be aware of.
Thanks in advance!
Related Posts with Creating a pooled variable with survey data
Non-convergence in IV PoissonDear Statalisters, I am using the IV Poisson model: Code: ivpoisson gmm dependent variable covari…
vce2way works in Stata 15.1 but not in 16Dear All, I find that (ssc install) -vce2way- command works in Stata 15.1 but not in Stata 16 in the…
range of quartilesDear colleagues, I have created 4 quartiles of a variable (age) that goes form 18 to 89. What is the…
How to show persistence using panel dataDear stata users and experts, My data is firm year panel data, i.e., I have observations at firm le…
Diff-in-Diff / Pooled / Random EffectHi everyone, I am concluding my master’s degree and would very much appreciate your experience on…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a pooled variable with survey data
Post a Comment