In this WPA, you will analyze data from a (again…fake) study on attraction. In the study, 1000 heterosexual University students viewed the Facebook profile of another student (the “target”) of the opposite sex. Based on a target’s profile, each participant made three judgments about the target - intelligence, attractiveness, and dateability. The primary judgement was a dateability rating indicating how dateable the person was on a scale of 0 to 100.
The data are located in a tab-delimited text file at http://nathanieldphillips.com/wp-content/uploads/2016/04/facebook.txt. Here is how the first few rows of the data should look:
## session sex age haircolor university education shirtless intelligence
## 1 1 m 23 brown 3.Geneva 3.Masters 2.Yes 1.low
## 2 1 m 19 blonde 2.Zurich 1.HighSchool 1.No 2.medium
## 3 1 f 22 brown 2.Zurich 2.Bachelors 2.Yes 1.low
## 4 1 f 22 red 2.Zurich 2.Bachelors 1.No 2.medium
## 5 1 m 23 brown 3.Geneva 2.Bachelors 1.No 2.medium
## 6 1 m 26 blonde 2.Zurich 3.Masters 2.Yes 3.high
## attractiveness dateability
## 1 3.high 15
## 2 2.medium 44
## 3 2.medium 100
## 4 3.high 100
## 5 2.medium 63
## 6 3.high 76
The data file has 1000 rows and 10 columns. Here are the columns
session: The experiment session in which the study was run. There were 50 total sessions.
sex: The sex of the target
age: The age of the target
haircolor: The haircolor of the target
university: The university that the target attended.
education: The highest level of education obtained by the target.
shirtless: Did the target have a shirtless profile picture? 1.No v 2.Yes
intelligence: How intelligent do you find this target? 1.Low, 2.Medium, 3.High
attractiveness: How physically attractive do you find this target? 1.Low, 2.Medium, 3.High
dateability: How dateable is this target? 0 to 100.
Open a new script and enter your name, date, and the wpa number at the top. Set the working directory to the appropriate location using setwd (or add the script to your R Project). Save the script in the R folder in your project working directory as wpa_7_LASTFIRST.R, where LAST and FIRST are your last and first names.
The data are stored in a tab–delimited text file located at http://nathanieldphillips.com/wp-content/uploads/2016/04/facebook.txt. Using read.table() load this data into R as a new object called facebook
Look at the first few rows of the dataframe with the head() function to make sure it loaded correctly.
Using the str() function, look at the structure of the dataframe to make sure everything looks ok
For each question, conduct the appropriate ANOVA. Write the conclusion in APA style. To summarize an effect in an ANOVA, use the format F(XXX, YYY) = FFF, p = PPP, where XXX is the degrees of freedom of the variable you are testing, YYY is the degrees of freedom of the residuals, FFF is the F value for the variable you are testing, and PPP is the p-value. If the p-value is less than .01, just write p < .01.
For the purposes of this class, if the p-value of the ANOVA is less than .05, conduct post-hoc tests. If you are only testing one independent variable, write APA conclusions for the post-hoc test. If you are testing more than one independent variable in your ANOVA, you do not need to write APA style conclusions for post-hoc tests – just print the result.
For example, here is how you would analyze and answer the question: “Was there an effect of diets on Chicken Weights?”"
# ANOVA on Chicken Weights
# IV = Diet, DV = weight
# ANOVA
p0.aov <- aov(formula = weight ~ Diet,
data = ChickWeight)
summary(p0.aov)
## Df Sum Sq Mean Sq F value Pr(>F)
## Diet 3 155863 51954 10.81 6.43e-07 ***
## Residuals 574 2758693 4806
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# ANOVA was significant (p < .01), so I'll conduct post-hoc tests
# Tukey post-hoc tests
TukeyHSD(p0.aov)
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = weight ~ Diet, data = ChickWeight)
##
## $Diet
## diff lwr upr p adj
## 2-1 19.971212 -0.2998092 40.24223 0.0552271
## 3-1 40.304545 20.0335241 60.57557 0.0000025
## 4-1 32.617257 12.2353820 52.99913 0.0002501
## 3-2 20.333333 -2.7268370 43.39350 0.1058474
## 4-2 12.646045 -10.5116315 35.80372 0.4954239
## 4-3 -7.687288 -30.8449649 15.47039 0.8277810
Answer: There was a significant main effect of diets on chicken weights (F(3, 574) = 10.81, p < .01). Pairwise Tukey HSD tests showed significant differences between diets 1 and 3 (diff = 40.30, p < .01) and diets 1 and 4 (diff = 32.62, p < .01). All other pairwise differences were not significant at the 0.05 significance threshold.
Was there a main effect of the university on dateability? Conduct a one-way ANOVA. If the result is significant (p < .05), conduct post-hoc tests
Was there a main effect of intelligence on dateability? Conduct a one-way ANOVA. If the result is significant (p < .05), conduct post-hoc tests
Was there a main effect of haircolor on dateability? Conduct a one-way ANOVA. If the result is significant (p < .05), conduct post-hoc tests
Conduct a two-way ANOVA on dateability with both university and haircolor as IVs. Do your results for each variable change compared to your previous one-way ANOVAs on these variables? (You do not need to give APA results or conduct post-hoc tests, just answer the question verbally).
Conduct a multi-way anova including sex, haircolor, university, education, shirtless, intelligence and attractiveness as independent variables predicting dateability. Do not include interactions. Which variables are significantly related to dateability? (Do write APA results for each variable but do not conduct post-hoc tests).
Create a plot (e.g.; pirateplot(), barplot(), boxplot()) showing dateability based on two independent variables: sex and shirtless. Based on what you see in the plot, do you expect there to be an interaction between sex and shirtless? Why or why not?
Test your prediction with the appropriate ANOVA
Create a plot (e.g.; pirateplot(), barplot(), boxplot()) showing the distribution of dateability based on two independent variables: university and haircolor. Based on what you see in the plot, do you expect there to be an interaction between university and intelligence? Why or why not?
Test your prediction with the appropriate ANOVA
Save and email your ‘.R’ file wpa_7_LastFirst.R to me at ashleyjames.luckman@unibas.ch. Put the subject as WPA7-23496-02.