## Facebook Attraction

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:

## Datafile description

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.

## Data loading and preparation

Open your class R project. Open a new script and enter your name, date, and the wpa number at the top. 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`

## Understand the data

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

## Answer guidelines Read carefully to save yourself time!

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.

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 I 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.*

## One-way ANOVAS

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

## Multi-independent ANOVAs

Conduct a three-way ANOVA on dateability with both intelligence, 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. WHich variables are significantly related to dateability? (

*Do*write APA results for each variable but do*not*conduct post-hoc tests).

### ANOVAs on subsets of data

- It turns out that the experimenter who ran sessions 1 through 30 (a man) was trying to score a date and slipped in his own profile picture into the study. We can’t trust these data. Repeat your multi anova from question 9 ONLY for sessions 31 through 50. Do your conclusions change compared to when you analyzed the data from all sessions?

## Interactions

Create a plot (e.g.;

`pirateplot()`

,`barplot()`

,`boxplot()`

) showing the distribution of 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

# CHECKPOINT!

### More interactions

Create a plot (e.g.;

`pirateplot()`

,`barplot()`

,`boxplot()`

) showing the distribution of 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

# Submit!

Save and email your `wpa_7_LastFirst.R`

file to me at nathaniel.phillips@unibas.ch. Then, go to https://goo.gl/forms/UblvQ6dvA76veEWu1 to complete the WPA submission form.