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
Gompertz mortalityDear Statalisters, I am working on mortality dataset. Each row represents the number of people born…
Ologit, Paralell Regression Assumption and weightsHi, it's the first time i write here, hope the question is not too emantary, I'm trying to replicat…
Propensity Score Matching - Multilevel DataHi all, For my Dissertation I am calculating a multilevel regression with data from a cross-nationa…
Moving cumulative sum over 10-year periodDear Statalist Community, I am currently struggling with a data transformation task and was wonderi…
Moving cumulative sum over 10-year periodDear Statalist Community, I am currently struggling with a data transformation task and was wonderi…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a pooled variable with survey data
Post a Comment