I am researching the effect of cosmetic combinations on the perception of leadership characteristics. I collected data on 24 images: 6 treatment versions of 4 images. Each survey respondent randomly saw 4 out of the 24 images.
The data that I collected consists of ratings of each photo on 6 leadership characteristics, hence 6 dependent variables. I, therefore, collected 24x6=144 rating values, each rating being given by approximately 27 respondents. The 6 treatment versions consist of 2 independent variables: brow enhancement (yes or no) and lipstick colour (none, pink, red).
Since I basically collected 144 ratings, Stata has imported the data as 144 variables. (see dataex below)
How can I transform the data such that I obtain 6 dependent variables and 2 independent variables from the observations in the 144 var's?
I think the problem with my data currently is that the variables pertain to the images rather than to the subject, which would be the case for e.g. control variables like gender, age etc. I.e.: Stata, of course, does not "know" that the images were comprised of combinations of 2 independent variables (2x3), so I need to specify that.
Rather than having the current variables in Stata listed as separate variables, I need to ensure that I group the data such that I obtain:
Dependent variables:
Intelligence (_1)
Dominance (_2)
Honesty&integrity (_3)
Self-confidence (_4)
Leadership effectiveness (_5)
Attractiveness (_6)
Independent variables:
Brows (1=yes, 2=nee)
Lipstick (none/pink/red)
As an example, this piece of data shows the observations for "a.neered_1-a.neered_6" and "a.yesnone_1-a.yesnone_6".
To clarify:
a.neered_1 contains all 24 ratings of the dependent variable "intelligence" for the one image (out of 24) where the woman in the stimulus had brows=nee (no eyebrow enhancement) and lipstick=red (red lipstick)
NB: the data from the four images can be aggregated, such that the observations from, for example, b.neered_1, c.neered_1 and d.neered_1 are added to the observations from a.neered_1.
With the data, I want to perform a two-way MANOVA, where I test if the ratings on all 6 dependent variables are significantly different on the two characteristics (brows & lipstick), and whether there are patterns between the relationships.
As a result, a possible outcome would be the form: "compared to not wearing make-up, wearing red lipstick significantly increases the rating of intelligence".
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte(aneered_1 aneered_2 aneered_3 aneered_4 aneered_5 aneered_6 ayesnone_1 ayesnone_2 ayesnone_3 ayesnone_4 ayesnone_5 ayesnone_6) . . . . . . 5 5 5 5 5 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 4 3 4 4 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 7 6 7 6 7 . . . . . . . . . . . . 4 2 3 2 3 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3 7 3 3 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 6 4 6 6 3 . . . . . . . . . . . . 4 6 3 6 6 3 . . . . . . . . . . . . . . . . . . . . . . . . 5 2 5 4 3 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 6 3 5 5 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2 4 2 3 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3 6 3 4 5 6 5 5 5 4 5 . . . . . . . . . . . . . . . . . . . . . . . . 4 3 7 4 4 4 . . . . . . . . . . . . . . . . . . . . . . . . 6 6 4 6 4 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 4 6 4 4 4 . . . . . . . . . . . . . . . . . . . . . . . . 5 4 4 4 4 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 6 5 5 7 4 5 5 4 5 5 5 . . . . . . 5 5 6 6 6 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 4 6 5 3 4 . . . . . . . . . . . . 4 6 3 5 4 3 . . . . . . . . . . . . . . . . . . . . . . . . 5 4 5 6 4 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2 5 3 2 5 . . . . . . . . . . . . . . . . . . . . . . . . 5 5 4 5 5 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 4 5 6 6 6 5 5 5 5 5 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 6 3 3 5 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 6 3 6 5 4 4 6 4 6 4 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 5 5 5 5 5 . . . . . . . . . . . . 6 6 6 6 5 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . end label var aneered_1 "a.NeeRed_1" label var aneered_2 "a.NeeRed_2" label var aneered_3 "a.NeeRed_3" label var aneered_4 "a.NeeRed_4" label var aneered_5 "a.NeeRed_5" label var aneered_6 "a.NeeRed_6" label var ayesnone_1 "a.YesNone_1" label var ayesnone_2 "a.YesNone_2" label var ayesnone_3 "a.YesNone_3" label var ayesnone_4 "a.YesNone_4" label var ayesnone_5 "a.YesNone_5" label var ayesnone_6 "a.YesNone_6"
Even more specific: I would need the variables such that the following variables include all observations from (using this data example):
Intelligence (_1): aneered_1, ayesnone_1
Dominance (_2): aneered_2, ayesnone_2
Honesty&integrity (_3): aneered_3, ayesnone_3
Self-confidence (_4): aneered_4, ayesnone_4
Leadership effectiveness (_5): aneered_5, ayesnone_5
Attractiveness (_6): aneered_6, ayesnone_6
Independent variables:
Brows:
1=yes: ayesnone_1, ayesnone_2, ayesnone_3, ayesnone_4, ayesnone_5, ayesnone_6
0=nee: aneered_1, aneered_2, aneered_3, aneered_4, aneered_5, aneered_6
Lipstick:
None: ayesnone_1, ayesnone_2, ayesnone_3, ayesnone_4, ayesnone_5, ayesnone_6
Red: aneered_1, aneered_2, aneered_3, aneered_4, aneered_5, aneered_6
Pink:
Sorry for the extremely long post, but I would not know how else to explain it without giving you all the necessary details! Hope someone can help!
0 Response to Data transformation: creating new variables out of independent survey answers
Post a Comment