Getting started

Clone the hw-03- repo and start a new project in RStudio. For more detailed instructions about getting started, see the Lab 01 instructions

Type the following lines of code in the console in RStudio filling in your Github username and the email address associated with your Github account.

library(usethis)
use_git_config(user.name = "your github username", 
               user.email="your email")

Tips on formatting

Now that we’ve had some practice with doing data wrangling, data visualization, and fitting models in R, let’s consider a few tips to help neatly format your analysis.

  • Resizing figures, to make the report more readable.
  • Using patchwork or similar packages to arrange multiple plots in a neat and organized way.
  • Displaying your results in a neatly organized way using tidy and kable.
  • Using code chunk options to suppress messages and warnings generated by the code in the final output.

Packages

We will use the following packages in this assignment:

library(tidyverse)
library(broom)
library(knitr)
library(patchwork)

#add other packages as needed

Questions

Part 1: Conceptual questions

In a 1991 study, Allen et. al sought to answer whether the presence of a close friend or pet affected a woman’s stress levels as she completed a challenging tasks. To test this, they conducted an experiment in which 45 women who were dog-owners were tasked with counting backwards by 13s or 17s under one of three test conditions (group):

  • C: Control group, Alone
  • F: Close friend present
  • P: Pet present

All of the participants were dog-owners who responded to an advertisement about the study.

The data is available in stress-experiment.csv in the data folder.

To quantify stress level, they measured each woman’s heart rate and blood pressure after she completed the task. For today’s analysis, we will focus on the heart rate (heart_rate).

We will use Analysis of Variance (ANOVA) to test whether there is an association between the presence of a friend or pet and stress level when completing challenging tasks.

  1. Visualize the distribution of heart rate and calculate summary statistics for each group.

  2. What do you observe from the visualizations and summary statistics? In your response, describe how the centers and spreads compare across groups, presence of outliers, and whether there appears to be a relationship between the testing conditions and heart rate.

  3. Make an ANOVA table for this data. Show your code and output.

  4. State the hypotheses that are being tested in the ANOVA table using (i) words and (ii) statistical notation. Hint: You can use this guide to find the LaTex code needed to write the hypotheses.

  5. Based on your table,

    • What does the MS for group tell you?
    • What does the MS for the residuals (error) tell you?

Write your responses in the context of the data.

  1. State your conclusion in the context of the data.

Part 2: Analysis in Pratice

In June 2020, Garbe, Rau and Toppe published the paper Influence of perceived threat of Covid-19 and HEXACO personality traits on toilet paper stockpiling. The objective their analysis was to examine the relationship between personality traits, perceived threat of Covid-19 and stockpiling toilet paper.

They conducted an online survey March 23 - 29, 2020 and used the results to fit multiple linear regression models to draw conclusions about their research questions. From their survey, they collected data on adults across 35 countries. Given the small number of responses from people outside of the United States, Canada and Europe, only responses from people in these three locations were included in the regression analysis.

Let’s consider their results for the model looking at the effect on perceived threat of Covid-19. The model can be found on page 6 of the paper. The perceived threat of Covid was quantified using the responses to the following survey question:

How threatened do you feel by Coronavirus? [Users select on a 10-point visual analogue scale (Not at all threatened to Extremely Threatened)]

  1. Interpret the coefficient of Age (0.072) in the context of the analysis.
  2. Interpret the coefficient of Place of residence in the context of the analysis.
  3. Calculate a 95% confidence interval for the coefficient of Days in quarantine. Interpret the interval in the context of the data. Note: There were 996 responses used for the analysis.
  4. The model includes an interaction between Place of residence and Emotionality (capturing differential tendencies in to worry and be anxious).
    • What does the coefficient for the interaction (0.101) mean in the context of the data?
    • Interpret the effect of Emotionality for a person who lives in the US/Canada.
    • Interpret the effect of Emotionality for a person who lives in Europe.

Grading

Total 50
Part 1: Conceptual questions 25
Part 2: Analysis in Practice 20
Document submitted as PDF with clear headers 2
Name and date updated in YAML 1
At least 3 informative commit messages 2