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
Identifying events within a future time windowDear Statalist users -- Assume that we have the following toy example: Code: input firm_id year ev…
putexcel problem with double replace and local macrosI think this is probably a bug report, but I'll just show what happens and let others decide. Mostly…
Create year variable from yearly-monthly data.Hi all, In the current dataset, I have yearly-monthly data and I would like to transform it into ye…
Moderating impactDear Statalist, Actually, I am bit confused between the joint effect and the moderating impact. I me…
Model Specification with GSEM Stata including both multilevel and simple regression modelling?Hello everyone! My research model includes both Level 1 (individual) and Level 2 (team) variables. I…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a pooled variable with survey data
Post a Comment