1 Loading Libraries

#install.packages("afex")
#install.packages("emmeans")
#install.packages("ggbeeswarm")

library(psych) # for the describe() command
## Warning: package 'psych' was built under R version 4.4.3
library(ggplot2) # to visualize our results
## Warning: package 'ggplot2' was built under R version 4.4.3
## 
## Attaching package: 'ggplot2'
## The following objects are masked from 'package:psych':
## 
##     %+%, alpha
library(expss) # for the cross_cases() command
## Warning: package 'expss' was built under R version 4.4.3
## Loading required package: maditr
## Warning: package 'maditr' was built under R version 4.4.3
## 
## To modify variables or add new variables:
##              let(mtcars, new_var = 42, new_var2 = new_var*hp) %>% head()
## 
## Attaching package: 'expss'
## The following object is masked from 'package:ggplot2':
## 
##     vars
library(car) # for the leveneTest() command
## Warning: package 'car' was built under R version 4.4.3
## Loading required package: carData
## Warning: package 'carData' was built under R version 4.4.3
## 
## Attaching package: 'car'
## The following object is masked from 'package:expss':
## 
##     recode
## The following object is masked from 'package:psych':
## 
##     logit
library(afex) # to run the ANOVA 
## Warning: package 'afex' was built under R version 4.4.3
## Loading required package: lme4
## Warning: package 'lme4' was built under R version 4.4.3
## Loading required package: Matrix
## 
## Attaching package: 'lme4'
## The following object is masked from 'package:expss':
## 
##     dummy
## ************
## Welcome to afex. For support visit: http://afex.singmann.science/
## - Functions for ANOVAs: aov_car(), aov_ez(), and aov_4()
## - Methods for calculating p-values with mixed(): 'S', 'KR', 'LRT', and 'PB'
## - 'afex_aov' and 'mixed' objects can be passed to emmeans() for follow-up tests
## - Get and set global package options with: afex_options()
## - Set sum-to-zero contrasts globally: set_sum_contrasts()
## - For example analyses see: browseVignettes("afex")
## ************
## 
## Attaching package: 'afex'
## The following object is masked from 'package:lme4':
## 
##     lmer
library(ggbeeswarm) # to run plot results
## Warning: package 'ggbeeswarm' was built under R version 4.4.3
library(emmeans) # for posthoc tests
## Warning: package 'emmeans' was built under R version 4.4.3
## Welcome to emmeans.
## Caution: You lose important information if you filter this package's results.
## See '? untidy'

2 Importing Data

# For HW, import the project dataset you cleaned previously this will be the dataset you'll use throughout the rest of the semester

d <- read.csv(file="Data/projectdata.csv", header=T)


# new code! this adds a column with a number for each row. It will make it easier if we need to drop outliers later
d$row_id <- 1:nrow(d)

3 State Your Hypothesis

Note: For your HW, you will choose to run EITHER a one-way ANOVA (a single IV with 3 or more levels) OR a two-way/factorial ANOVA (at least two IVs with 2 or 3 levels each). You will need to specify your hypothesis and customize your code based on the choice you make. We will run BOTH versions of the test in the lab for illustrative purposes.

One-Way: We predict that there will be a significant difference in people’s level of pandemic anxiety based on their general anxiety disorder symptoms (from (1) not present to (4) present every day).

4 Check Your Variables

# you only need to check the variables you're using in the current analysis
# even if you checked them previously, it's always a good idea to look them over again and be sure that everything is correct
str(d)
## 'data.frame':    1185 obs. of  8 variables:
##  $ X        : int  1 321 401 520 1390 1422 1849 2183 2247 2526 ...
##  $ gender   : chr  "female" "male" "female" "female" ...
##  $ trans    : chr  "no" "no" "no" "no" ...
##  $ pas_covid: num  3.22 2.33 4 3 2.89 ...
##  $ pss      : num  3.25 2.25 2.25 2.75 2.75 4.75 3.25 3.5 2.25 3.5 ...
##  $ gad      : num  1.86 1 2.14 1.14 1 ...
##  $ swemws   : num  2.86 3.86 3.71 3 2.57 ...
##  $ row_id   : int  1 2 3 4 5 6 7 8 9 10 ...
# make our categorical variables of interest factors
# because we'll use our newly created row ID variable for this analysis, so make sure it's coded as a factor, too.
d$gad <- as.factor(d$gad) 
d$row_id <- as.factor(d$row_id)

# we're going to recode our race variable into two groups: poc and white
# in doing so, we are creating a new variable "poc" that has 2 levels
table(d$gad)
## 
##           1 1.142857143 1.285714286 1.428571429 1.571428571 1.714285714 
##         163         114          87          90          95          75 
## 1.857142857           2 2.142857143 2.285714286 2.428571429 2.571428571 
##          44          54          36          41          32          38 
## 2.714285714 2.857142857           3 3.142857143 3.285714286 3.428571429 
##          51          36          32          31          33          30 
## 3.571428571 3.714285714 3.857142857           4 
##          17          19          14          53
# check that all our categorical variables of interest are now factors
str(d)
## 'data.frame':    1185 obs. of  8 variables:
##  $ X        : int  1 321 401 520 1390 1422 1849 2183 2247 2526 ...
##  $ gender   : chr  "female" "male" "female" "female" ...
##  $ trans    : chr  "no" "no" "no" "no" ...
##  $ pas_covid: num  3.22 2.33 4 3 2.89 ...
##  $ pss      : num  3.25 2.25 2.25 2.75 2.75 4.75 3.25 3.5 2.25 3.5 ...
##  $ gad      : Factor w/ 22 levels "1","1.142857143",..: 7 1 9 2 1 5 14 11 4 6 ...
##  $ swemws   : num  2.86 3.86 3.71 3 2.57 ...
##  $ row_id   : Factor w/ 1185 levels "1","2","3","4",..: 1 2 3 4 5 6 7 8 9 10 ...
# check our DV skew and kurtosis
describe(d$pas_covid)
##    vars    n mean   sd median trimmed  mad min max range  skew kurtosis   se
## X1    1 1185 3.22 0.68   3.22    3.23 0.66   1   5     4 -0.16     0.03 0.02
# we'll use the describeBy() command to view our DV's skew and kurtosis across our IVs' levels
describeBy(d$pas_covid, group = d$gad)
## 
##  Descriptive statistics by group 
## group: 1
##    vars   n mean   sd median trimmed  mad  min  max range skew kurtosis   se
## X1    1 163 2.81 0.69   2.78     2.8 0.66 1.22 4.67  3.44 0.19    -0.18 0.05
## ------------------------------------------------------------ 
## group: 1.142857143
##    vars   n mean   sd median trimmed  mad  min  max range  skew kurtosis   se
## X1    1 114 2.94 0.58      3    2.96 0.49 1.33 4.78  3.44 -0.23     0.47 0.05
## ------------------------------------------------------------ 
## group: 1.285714286
##    vars  n mean  sd median trimmed  mad  min max range skew kurtosis   se
## X1    1 87 2.99 0.5      3    3.01 0.49 1.67   4  2.33 -0.3     -0.4 0.05
## ------------------------------------------------------------ 
## group: 1.428571429
##    vars  n mean   sd median trimmed  mad  min  max range  skew kurtosis   se
## X1    1 90 3.13 0.62   3.11    3.16 0.66 1.44 4.78  3.33 -0.27     0.15 0.07
## ------------------------------------------------------------ 
## group: 1.571428571
##    vars  n mean   sd median trimmed  mad  min  max range  skew kurtosis   se
## X1    1 95 3.23 0.56   3.33    3.24 0.49 1.67 4.56  2.89 -0.22     0.08 0.06
## ------------------------------------------------------------ 
## group: 1.714285714
##    vars  n mean   sd median trimmed  mad min  max range  skew kurtosis   se
## X1    1 75 3.23 0.65   3.22    3.25 0.66   1 4.89  3.89 -0.45     1.22 0.07
## ------------------------------------------------------------ 
## group: 1.857142857
##    vars  n mean   sd median trimmed  mad min  max range skew kurtosis   se
## X1    1 44 3.29 0.58   3.22    3.27 0.49   2 4.67  2.67  0.3    -0.04 0.09
## ------------------------------------------------------------ 
## group: 2
##    vars  n mean   sd median trimmed  mad  min max range skew kurtosis   se
## X1    1 54 3.26 0.53   3.22    3.26 0.49 2.11   5  2.89 0.36     0.93 0.07
## ------------------------------------------------------------ 
## group: 2.142857143
##    vars  n mean   sd median trimmed  mad  min  max range  skew kurtosis   se
## X1    1 36 3.32 0.65   3.44    3.37 0.66 1.78 4.33  2.56 -0.58    -0.36 0.11
## ------------------------------------------------------------ 
## group: 2.285714286
##    vars  n mean   sd median trimmed  mad  min  max range skew kurtosis   se
## X1    1 41  3.3 0.73   3.33    3.34 0.82 1.44 4.44     3 -0.4    -0.29 0.11
## ------------------------------------------------------------ 
## group: 2.428571429
##    vars  n mean   sd median trimmed  mad  min  max range  skew kurtosis   se
## X1    1 32 3.35 0.61   3.33    3.37 0.66 1.78 4.56  2.78 -0.27    -0.27 0.11
## ------------------------------------------------------------ 
## group: 2.571428571
##    vars  n mean   sd median trimmed  mad  min  max range  skew kurtosis   se
## X1    1 38 3.25 0.66   3.33    3.24 0.82 2.11 4.56  2.44 -0.01    -0.94 0.11
## ------------------------------------------------------------ 
## group: 2.714285714
##    vars  n mean   sd median trimmed  mad min  max range  skew kurtosis   se
## X1    1 51 3.48 0.54   3.56    3.52 0.49   2 4.33  2.33 -0.61     -0.2 0.08
## ------------------------------------------------------------ 
## group: 2.857142857
##    vars  n mean   sd median trimmed  mad min  max range  skew kurtosis   se
## X1    1 36  3.6 0.63   3.72    3.64 0.58   2 4.56  2.56 -0.48    -0.34 0.11
## ------------------------------------------------------------ 
## group: 3
##    vars  n mean   sd median trimmed  mad  min  max range  skew kurtosis   se
## X1    1 32  3.4 0.54   3.44    3.41 0.66 2.33 4.33     2 -0.11     -1.1 0.09
## ------------------------------------------------------------ 
## group: 3.142857143
##    vars  n mean   sd median trimmed  mad min  max range  skew kurtosis   se
## X1    1 31 3.52 0.69   3.44    3.53 0.66   2 4.78  2.78 -0.18    -0.54 0.12
## ------------------------------------------------------------ 
## group: 3.285714286
##    vars  n mean  sd median trimmed  mad  min  max range  skew kurtosis  se
## X1    1 33 3.38 0.6   3.44    3.42 0.66 1.78 4.44  2.67 -0.62     0.11 0.1
## ------------------------------------------------------------ 
## group: 3.428571429
##    vars  n mean   sd median trimmed  mad  min  max range  skew kurtosis   se
## X1    1 30 3.43 0.75   3.44    3.47 0.66 1.22 4.67  3.44 -0.66     0.65 0.14
## ------------------------------------------------------------ 
## group: 3.571428571
##    vars  n mean   sd median trimmed  mad  min  max range  skew kurtosis   se
## X1    1 17 3.59 0.65   3.67    3.61 0.33 1.89 4.89     3 -0.63     0.99 0.16
## ------------------------------------------------------------ 
## group: 3.714285714
##    vars  n mean   sd median trimmed  mad  min max range skew kurtosis   se
## X1    1 19 3.77 0.58   3.67    3.76 0.66 2.67   5  2.33 0.15    -0.68 0.13
## ------------------------------------------------------------ 
## group: 3.857142857
##    vars  n mean   sd median trimmed  mad  min  max range  skew kurtosis   se
## X1    1 14 3.74 0.83   3.94    3.88 0.25 1.22 4.56  3.33 -1.87     3.12 0.22
## ------------------------------------------------------------ 
## group: 4
##    vars  n mean   sd median trimmed  mad  min max range  skew kurtosis   se
## X1    1 53 3.78 0.82   3.89    3.85 0.82 1.44   5  3.56 -0.72     0.19 0.11
# also use histograms to examine your continuous variable
hist(d$pas_covid)

# and cross_cases() to examine your categorical variables' cell count
cross_cases(d, gad)
 #Total 
 gad 
   1  163
   1.142857143  114
   1.285714286  87
   1.428571429  90
   1.571428571  95
   1.714285714  75
   1.857142857  44
   2  54
   2.142857143  36
   2.285714286  41
   2.428571429  32
   2.571428571  38
   2.714285714  51
   2.857142857  36
   3  32
   3.142857143  31
   3.285714286  33
   3.428571429  30
   3.571428571  17
   3.714285714  19
   3.857142857  14
   4  53
   #Total cases  1185
# REMEMBER your test's level of POWER is determined by your SMALLEST subsample

5 Check Your Assumptions

5.1 ANOVA Assumptions

  • DV should be normally distributed across levels of the IV (we checked previously using “describeBy” function)
  • All levels of the IVs should have equal number of cases and there should be no empty cells. Cells with low numbers decrease the power of the test (which increases chance of Type II error)
  • Homogeneity of variance should be assured (using Levene’s Test)
  • Outliers should be identified and removed – we will actually remove them this time!
  • If you have confirmed everything above, the sampling distribution should be normal.

5.1.1 Check levels of IVs

# One-Way
table(d$gad)
## 
##           1 1.142857143 1.285714286 1.428571429 1.571428571 1.714285714 
##         163         114          87          90          95          75 
## 1.857142857           2 2.142857143 2.285714286 2.428571429 2.571428571 
##          44          54          36          41          32          38 
## 2.714285714 2.857142857           3 3.142857143 3.285714286 3.428571429 
##          51          36          32          31          33          30 
## 3.571428571 3.714285714 3.857142857           4 
##          17          19          14          53
# our small number of participants owning rabbits is going to hurt us for the two-way anova, but it should be okay for the one-way anova

5.1.2 Check homogeneity of variance

# use the leveneTest() command from the car package to test homogeneity of variance
# uses the 'formula' setup: formula is y~x1*x2, where y is our DV and x1 is our first IV and x2 is our second IV

# One-Way
leveneTest(pas_covid~gad, data = d)
## Levene's Test for Homogeneity of Variance (center = median)
##         Df F value Pr(>F)
## group   21  1.3764 0.1193
##       1163

5.1.3 Check for outliers using Cook’s distance and Residuals VS Leverage plot

5.1.3.1 Run a Regression to get these outlier plots

# use this commented out section below ONLY IF if you need to remove outliers
# to drop a single outlier, use this code:
d <- subset(d, row_id!=c(329))

# to drop multiple outliers, use this code:
# d <- subset(d, row_id!=c(1108) & row_id!=c(602))


# use the lm() command to run the regression
# formula is y~x1*x2 + c, where y is our DV, x1 is our first IV, x2 is our second IV.
reg_model <- lm(pas_covid~gad, data = d) #for One-Way

5.1.3.2 Check for outliers (One-Way)

# Cook's distance
plot(reg_model, 4)

# Residuals VS Leverage
plot(reg_model, 5)

5.2 Issues with My Data

Our cell sizes are very ubalanced between the pet type group levels. A small sample size for one of the levels of our variable limits our power and increases our Type II error rate.

Levene’s test was significant for our three-level pet type variable with the One-Way ANOVA. We are ignoring this and continuing with the analysis anyway for this class.

We identified and removed a single outlier for the One-Way ANOVA.

[UPDATE this section in your HW.]

6 Run an ANOVA

# One-Way
aov_model <- aov_ez(data = d,
                    id = "X",
                    between = c("gad"),
                    dv = "pas_covid",
                    anova_table = list(es = "pes"))
## Contrasts set to contr.sum for the following variables: gad

7 View Output

nice(aov_model)
## Anova Table (Type 3 tests)
## 
## Response: pas_covid
##   Effect       df  MSE         F  pes p.value
## 1    gad 21, 1162 0.39 10.88 *** .164   <.001
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1

ANOVA Effect Size [partial eta-squared] cutoffs from Cohen (1988): * η^2 < 0.01 indicates a trivial effect * η^2 >= 0.01 indicates a small effect * η^2 >= 0.06 indicates a medium effect * η^2 >= 0.14 indicates a large effect

8 Visualize Results

# One-Way
afex_plot(aov_model, x = "gad")

# Run Posthoc Tests (One-Way)

#ONLY run posthoc IF the ANOVA test is SIGNIFICANT! E.g., only run the posthoc tests on pet type if there is a main effect for pet type

emmeans(aov_model, specs="gad", adjust="sidak")
##  gad         emmean     SE   df lower.CL upper.CL
##  1             2.81 0.0489 1162     2.66     2.96
##  1.142857143   2.94 0.0585 1162     2.76     3.11
##  1.285714286   2.99 0.0670 1162     2.79     3.20
##  1.428571429   3.13 0.0659 1162     2.93     3.33
##  1.571428571   3.23 0.0641 1162     3.04     3.43
##  1.714285714   3.23 0.0722 1162     3.01     3.45
##  1.857142857   3.29 0.0942 1162     3.00     3.57
##  2             3.26 0.0850 1162     3.00     3.52
##  2.142857143   3.32 0.1040 1162     3.01     3.64
##  2.285714286   3.30 0.0976 1162     3.00     3.60
##  2.428571429   3.35 0.1100 1162     3.02     3.69
##  2.571428571   3.25 0.1010 1162     2.94     3.56
##  2.714285714   3.48 0.0875 1162     3.21     3.74
##  2.857142857   3.60 0.1040 1162     3.28     3.92
##  3             3.40 0.1100 1162     3.06     3.74
##  3.142857143   3.52 0.1120 1162     3.18     3.87
##  3.285714286   3.38 0.1090 1162     3.05     3.72
##  3.428571429   3.43 0.1140 1162     3.09     3.78
##  3.571428571   3.59 0.1520 1162     3.13     4.05
##  3.714285714   3.77 0.1430 1162     3.33     4.21
##  3.857142857   3.93 0.1730 1162     3.40     4.46
##  4             3.78 0.0858 1162     3.52     4.05
## 
## Confidence level used: 0.95 
## Conf-level adjustment: sidak method for 22 estimates
pairs(emmeans(aov_model, specs="gad", adjust="sidak"))
##  contrast                        estimate     SE   df t.ratio p.value
##  gad1 - gad1.142857143            -0.1218 0.0763 1162  -1.596  0.9940
##  gad1 - gad1.285714286            -0.1772 0.0830 1162  -2.135  0.8722
##  gad1 - gad1.428571429            -0.3157 0.0821 1162  -3.848  0.0214
##  gad1 - gad1.571428571            -0.4188 0.0807 1162  -5.193  0.0001
##  gad1 - gad1.714285714            -0.4142 0.0872 1162  -4.751  0.0005
##  gad1 - gad1.857142857            -0.4714 0.1060 1162  -4.441  0.0020
##  gad1 - gad2                      -0.4495 0.0981 1162  -4.581  0.0011
##  gad1 - gad2.142857143            -0.5102 0.1150 1162  -4.434  0.0020
##  gad1 - gad2.285714286            -0.4842 0.1090 1162  -4.435  0.0020
##  gad1 - gad2.428571429            -0.5403 0.1210 1162  -4.472  0.0017
##  gad1 - gad2.571428571            -0.4346 0.1130 1162  -3.861  0.0204
##  gad1 - gad2.714285714            -0.6632 0.1000 1162  -6.615  <.0001
##  gad1 - gad2.857142857            -0.7879 0.1150 1162  -6.848  <.0001
##  gad1 - gad3                      -0.5854 0.1210 1162  -4.845  0.0003
##  gad1 - gad3.142857143            -0.7094 0.1220 1162  -5.794  <.0001
##  gad1 - gad3.285714286            -0.5699 0.1190 1162  -4.778  0.0004
##  gad1 - gad3.428571429            -0.6194 0.1240 1162  -4.990  0.0002
##  gad1 - gad3.571428571            -0.7743 0.1590 1162  -4.862  0.0003
##  gad1 - gad3.714285714            -0.9580 0.1510 1162  -6.325  <.0001
##  gad1 - gad3.857142857            -1.1177 0.1800 1162  -6.207  <.0001
##  gad1 - gad4                      -0.9702 0.0988 1162  -9.819  <.0001
##  gad1.142857143 - gad1.285714286  -0.0554 0.0890 1162  -0.623  1.0000
##  gad1.142857143 - gad1.428571429  -0.1940 0.0881 1162  -2.201  0.8378
##  gad1.142857143 - gad1.571428571  -0.2971 0.0868 1162  -3.422  0.0875
##  gad1.142857143 - gad1.714285714  -0.2925 0.0929 1162  -3.148  0.1861
##  gad1.142857143 - gad1.857142857  -0.3497 0.1110 1162  -3.153  0.1838
##  gad1.142857143 - gad2            -0.3277 0.1030 1162  -3.175  0.1741
##  gad1.142857143 - gad2.142857143  -0.3884 0.1190 1162  -3.251  0.1423
##  gad1.142857143 - gad2.285714286  -0.3624 0.1140 1162  -3.185  0.1694
##  gad1.142857143 - gad2.428571429  -0.4185 0.1250 1162  -3.348  0.1088
##  gad1.142857143 - gad2.571428571  -0.3129 0.1170 1162  -2.673  0.4954
##  gad1.142857143 - gad2.714285714  -0.5415 0.1050 1162  -5.144  0.0001
##  gad1.142857143 - gad2.857142857  -0.6662 0.1190 1162  -5.577  <.0001
##  gad1.142857143 - gad3            -0.4636 0.1250 1162  -3.709  0.0349
##  gad1.142857143 - gad3.142857143  -0.5876 0.1270 1162  -4.643  0.0008
##  gad1.142857143 - gad3.285714286  -0.4482 0.1240 1162  -3.628  0.0458
##  gad1.142857143 - gad3.428571429  -0.4977 0.1280 1162  -3.881  0.0189
##  gad1.142857143 - gad3.571428571  -0.6526 0.1620 1162  -4.017  0.0114
##  gad1.142857143 - gad3.714285714  -0.8363 0.1550 1162  -5.401  <.0001
##  gad1.142857143 - gad3.857142857  -0.9960 0.1830 1162  -5.445  <.0001
##  gad1.142857143 - gad4            -0.8484 0.1040 1162  -8.167  <.0001
##  gad1.285714286 - gad1.428571429  -0.1386 0.0939 1162  -1.475  0.9979
##  gad1.285714286 - gad1.571428571  -0.2417 0.0927 1162  -2.607  0.5481
##  gad1.285714286 - gad1.714285714  -0.2371 0.0985 1162  -2.408  0.7024
##  gad1.285714286 - gad1.857142857  -0.2943 0.1160 1162  -2.546  0.5962
##  gad1.285714286 - gad2            -0.2723 0.1080 1162  -2.516  0.6202
##  gad1.285714286 - gad2.142857143  -0.3330 0.1240 1162  -2.689  0.4826
##  gad1.285714286 - gad2.285714286  -0.3070 0.1180 1162  -2.594  0.5581
##  gad1.285714286 - gad2.428571429  -0.3631 0.1290 1162  -2.811  0.3905
##  gad1.285714286 - gad2.571428571  -0.2575 0.1210 1162  -2.119  0.8799
##  gad1.285714286 - gad2.714285714  -0.4861 0.1100 1162  -4.411  0.0023
##  gad1.285714286 - gad2.857142857  -0.6108 0.1240 1162  -4.933  0.0002
##  gad1.285714286 - gad3            -0.4082 0.1290 1162  -3.160  0.1806
##  gad1.285714286 - gad3.142857143  -0.5322 0.1310 1162  -4.072  0.0092
##  gad1.285714286 - gad3.285714286  -0.3928 0.1280 1162  -3.075  0.2228
##  gad1.285714286 - gad3.428571429  -0.4423 0.1320 1162  -3.343  0.1103
##  gad1.285714286 - gad3.571428571  -0.5972 0.1660 1162  -3.604  0.0496
##  gad1.285714286 - gad3.714285714  -0.7809 0.1580 1162  -4.935  0.0002
##  gad1.285714286 - gad3.857142857  -0.9406 0.1860 1162  -5.062  0.0001
##  gad1.285714286 - gad4            -0.7930 0.1090 1162  -7.283  <.0001
##  gad1.428571429 - gad1.571428571  -0.1031 0.0919 1162  -1.122  1.0000
##  gad1.428571429 - gad1.714285714  -0.0985 0.0977 1162  -1.008  1.0000
##  gad1.428571429 - gad1.857142857  -0.1557 0.1150 1162  -1.355  0.9994
##  gad1.428571429 - gad2            -0.1337 0.1080 1162  -1.243  0.9998
##  gad1.428571429 - gad2.142857143  -0.1944 0.1230 1162  -1.578  0.9948
##  gad1.428571429 - gad2.285714286  -0.1685 0.1180 1162  -1.431  0.9986
##  gad1.428571429 - gad2.428571429  -0.2245 0.1290 1162  -1.746  0.9822
##  gad1.428571429 - gad2.571428571  -0.1189 0.1210 1162  -0.984  1.0000
##  gad1.428571429 - gad2.714285714  -0.3475 0.1100 1162  -3.173  0.1748
##  gad1.428571429 - gad2.857142857  -0.4722 0.1230 1162  -3.832  0.0226
##  gad1.428571429 - gad3            -0.2697 0.1290 1162  -2.097  0.8900
##  gad1.428571429 - gad3.142857143  -0.3937 0.1300 1162  -3.025  0.2500
##  gad1.428571429 - gad3.285714286  -0.2542 0.1270 1162  -1.999  0.9278
##  gad1.428571429 - gad3.428571429  -0.3037 0.1320 1162  -2.306  0.7743
##  gad1.428571429 - gad3.571428571  -0.4586 0.1650 1162  -2.775  0.4166
##  gad1.428571429 - gad3.714285714  -0.6423 0.1580 1162  -4.071  0.0092
##  gad1.428571429 - gad3.857142857  -0.8020 0.1850 1162  -4.326  0.0033
##  gad1.428571429 - gad4            -0.6544 0.1080 1162  -6.049  <.0001
##  gad1.571428571 - gad1.714285714   0.0046 0.0965 1162   0.048  1.0000
##  gad1.571428571 - gad1.857142857  -0.0526 0.1140 1162  -0.462  1.0000
##  gad1.571428571 - gad2            -0.0306 0.1060 1162  -0.288  1.0000
##  gad1.571428571 - gad2.142857143  -0.0913 0.1220 1162  -0.747  1.0000
##  gad1.571428571 - gad2.285714286  -0.0654 0.1170 1162  -0.560  1.0000
##  gad1.571428571 - gad2.428571429  -0.1214 0.1280 1162  -0.951  1.0000
##  gad1.571428571 - gad2.571428571  -0.0158 0.1200 1162  -0.132  1.0000
##  gad1.571428571 - gad2.714285714  -0.2444 0.1080 1162  -2.253  0.8077
##  gad1.571428571 - gad2.857142857  -0.3691 0.1220 1162  -3.018  0.2541
##  gad1.571428571 - gad3            -0.1666 0.1280 1162  -1.304  0.9996
##  gad1.571428571 - gad3.142857143  -0.2905 0.1290 1162  -2.248  0.8106
##  gad1.571428571 - gad3.285714286  -0.1511 0.1260 1162  -1.197  0.9999
##  gad1.571428571 - gad3.428571429  -0.2006 0.1310 1162  -1.533  0.9964
##  gad1.571428571 - gad3.571428571  -0.3555 0.1650 1162  -2.160  0.8597
##  gad1.571428571 - gad3.714285714  -0.5392 0.1570 1162  -3.434  0.0846
##  gad1.571428571 - gad3.857142857  -0.6989 0.1850 1162  -3.782  0.0271
##  gad1.571428571 - gad4            -0.5513 0.1070 1162  -5.146  0.0001
##  gad1.714285714 - gad1.857142857  -0.0572 0.1190 1162  -0.482  1.0000
##  gad1.714285714 - gad2            -0.0352 0.1120 1162  -0.316  1.0000
##  gad1.714285714 - gad2.142857143  -0.0959 0.1270 1162  -0.757  1.0000
##  gad1.714285714 - gad2.285714286  -0.0700 0.1210 1162  -0.576  1.0000
##  gad1.714285714 - gad2.428571429  -0.1260 0.1320 1162  -0.955  1.0000
##  gad1.714285714 - gad2.571428571  -0.0204 0.1240 1162  -0.164  1.0000
##  gad1.714285714 - gad2.714285714  -0.2490 0.1130 1162  -2.195  0.8411
##  gad1.714285714 - gad2.857142857  -0.3737 0.1270 1162  -2.950  0.2956
##  gad1.714285714 - gad3            -0.1712 0.1320 1162  -1.297  0.9997
##  gad1.714285714 - gad3.142857143  -0.2951 0.1330 1162  -2.212  0.8317
##  gad1.714285714 - gad3.285714286  -0.1557 0.1310 1162  -1.193  0.9999
##  gad1.714285714 - gad3.428571429  -0.2052 0.1350 1162  -1.520  0.9968
##  gad1.714285714 - gad3.571428571  -0.3601 0.1680 1162  -2.145  0.8673
##  gad1.714285714 - gad3.714285714  -0.5438 0.1600 1162  -3.388  0.0968
##  gad1.714285714 - gad3.857142857  -0.7035 0.1880 1162  -3.747  0.0306
##  gad1.714285714 - gad4            -0.5559 0.1120 1162  -4.958  0.0002
##  gad1.857142857 - gad2             0.0220 0.1270 1162   0.173  1.0000
##  gad1.857142857 - gad2.142857143  -0.0387 0.1400 1162  -0.276  1.0000
##  gad1.857142857 - gad2.285714286  -0.0127 0.1360 1162  -0.094  1.0000
##  gad1.857142857 - gad2.428571429  -0.0688 0.1450 1162  -0.474  1.0000
##  gad1.857142857 - gad2.571428571   0.0368 0.1380 1162   0.266  1.0000
##  gad1.857142857 - gad2.714285714  -0.1918 0.1290 1162  -1.492  0.9975
##  gad1.857142857 - gad2.857142857  -0.3165 0.1400 1162  -2.254  0.8071
##  gad1.857142857 - gad3            -0.1140 0.1450 1162  -0.785  1.0000
##  gad1.857142857 - gad3.142857143  -0.2379 0.1470 1162  -1.624  0.9925
##  gad1.857142857 - gad3.285714286  -0.0985 0.1440 1162  -0.684  1.0000
##  gad1.857142857 - gad3.428571429  -0.1480 0.1480 1162  -1.000  1.0000
##  gad1.857142857 - gad3.571428571  -0.3029 0.1780 1162  -1.697  0.9872
##  gad1.857142857 - gad3.714285714  -0.4866 0.1720 1162  -2.837  0.3718
##  gad1.857142857 - gad3.857142857  -0.6463 0.1970 1162  -3.276  0.1329
##  gad1.857142857 - gad4            -0.4987 0.1270 1162  -3.913  0.0168
##  gad2 - gad2.142857143            -0.0607 0.1340 1162  -0.451  1.0000
##  gad2 - gad2.285714286            -0.0347 0.1290 1162  -0.268  1.0000
##  gad2 - gad2.428571429            -0.0908 0.1390 1162  -0.651  1.0000
##  gad2 - gad2.571428571             0.0148 0.1320 1162   0.112  1.0000
##  gad2 - gad2.714285714            -0.2137 0.1220 1162  -1.752  0.9815
##  gad2 - gad2.857142857            -0.3385 0.1340 1162  -2.518  0.6186
##  gad2 - gad3                      -0.1359 0.1390 1162  -0.975  1.0000
##  gad2 - gad3.142857143            -0.2599 0.1410 1162  -1.846  0.9672
##  gad2 - gad3.285714286            -0.1205 0.1380 1162  -0.873  1.0000
##  gad2 - gad3.428571429            -0.1700 0.1420 1162  -1.195  0.9999
##  gad2 - gad3.571428571            -0.3249 0.1740 1162  -1.869  0.9626
##  gad2 - gad3.714285714            -0.5086 0.1670 1162  -3.051  0.2355
##  gad2 - gad3.857142857            -0.6682 0.1930 1162  -3.462  0.0777
##  gad2 - gad4                      -0.5207 0.1210 1162  -4.310  0.0035
##  gad2.142857143 - gad2.285714286   0.0260 0.1430 1162   0.182  1.0000
##  gad2.142857143 - gad2.428571429  -0.0301 0.1520 1162  -0.198  1.0000
##  gad2.142857143 - gad2.571428571   0.0755 0.1450 1162   0.520  1.0000
##  gad2.142857143 - gad2.714285714  -0.1531 0.1360 1162  -1.125  1.0000
##  gad2.142857143 - gad2.857142857  -0.2778 0.1470 1162  -1.886  0.9590
##  gad2.142857143 - gad3            -0.0752 0.1520 1162  -0.496  1.0000
##  gad2.142857143 - gad3.142857143  -0.1992 0.1530 1162  -1.301  0.9997
##  gad2.142857143 - gad3.285714286  -0.0598 0.1510 1162  -0.397  1.0000
##  gad2.142857143 - gad3.428571429  -0.1093 0.1540 1162  -0.707  1.0000
##  gad2.142857143 - gad3.571428571  -0.2642 0.1840 1162  -1.437  0.9985
##  gad2.142857143 - gad3.714285714  -0.4479 0.1770 1162  -2.528  0.6107
##  gad2.142857143 - gad3.857142857  -0.6075 0.2020 1162  -3.005  0.2618
##  gad2.142857143 - gad4            -0.4600 0.1350 1162  -3.409  0.0912
##  gad2.285714286 - gad2.428571429  -0.0561 0.1470 1162  -0.380  1.0000
##  gad2.285714286 - gad2.571428571   0.0496 0.1410 1162   0.352  1.0000
##  gad2.285714286 - gad2.714285714  -0.1790 0.1310 1162  -1.366  0.9993
##  gad2.285714286 - gad2.857142857  -0.3037 0.1430 1162  -2.128  0.8756
##  gad2.285714286 - gad3            -0.1012 0.1470 1162  -0.687  1.0000
##  gad2.285714286 - gad3.142857143  -0.2252 0.1490 1162  -1.514  0.9970
##  gad2.285714286 - gad3.285714286  -0.0857 0.1460 1162  -0.587  1.0000
##  gad2.285714286 - gad3.428571429  -0.1352 0.1500 1162  -0.901  1.0000
##  gad2.285714286 - gad3.571428571  -0.2901 0.1800 1162  -1.610  0.9933
##  gad2.285714286 - gad3.714285714  -0.4738 0.1730 1162  -2.732  0.4492
##  gad2.285714286 - gad3.857142857  -0.6335 0.1990 1162  -3.185  0.1694
##  gad2.285714286 - gad4            -0.4860 0.1300 1162  -3.739  0.0314
##  gad2.428571429 - gad2.571428571   0.1056 0.1500 1162   0.705  1.0000
##  gad2.428571429 - gad2.714285714  -0.1230 0.1410 1162  -0.873  1.0000
##  gad2.428571429 - gad2.857142857  -0.2477 0.1520 1162  -1.632  0.9921
##  gad2.428571429 - gad3            -0.0451 0.1560 1162  -0.289  1.0000
##  gad2.428571429 - gad3.142857143  -0.1691 0.1570 1162  -1.074  1.0000
##  gad2.428571429 - gad3.285714286  -0.0297 0.1550 1162  -0.191  1.0000
##  gad2.428571429 - gad3.428571429  -0.0792 0.1590 1162  -0.499  1.0000
##  gad2.428571429 - gad3.571428571  -0.2341 0.1880 1162  -1.248  0.9998
##  gad2.428571429 - gad3.714285714  -0.4178 0.1810 1162  -2.308  0.7723
##  gad2.428571429 - gad3.857142857  -0.5775 0.2060 1162  -2.810  0.3911
##  gad2.428571429 - gad4            -0.4299 0.1400 1162  -3.073  0.2236
##  gad2.571428571 - gad2.714285714  -0.2286 0.1340 1162  -1.707  0.9863
##  gad2.571428571 - gad2.857142857  -0.3533 0.1450 1162  -2.431  0.6852
##  gad2.571428571 - gad3            -0.1508 0.1500 1162  -1.006  1.0000
##  gad2.571428571 - gad3.142857143  -0.2748 0.1510 1162  -1.817  0.9723
##  gad2.571428571 - gad3.285714286  -0.1353 0.1490 1162  -0.910  1.0000
##  gad2.571428571 - gad3.428571429  -0.1848 0.1530 1162  -1.211  0.9999
##  gad2.571428571 - gad3.571428571  -0.3397 0.1820 1162  -1.863  0.9638
##  gad2.571428571 - gad3.714285714  -0.5234 0.1760 1162  -2.981  0.2760
##  gad2.571428571 - gad3.857142857  -0.6831 0.2010 1162  -3.402  0.0929
##  gad2.571428571 - gad4            -0.5355 0.1330 1162  -4.032  0.0107
##  gad2.714285714 - gad2.857142857  -0.1247 0.1360 1162  -0.917  1.0000
##  gad2.714285714 - gad3             0.0778 0.1410 1162   0.552  1.0000
##  gad2.714285714 - gad3.142857143  -0.0462 0.1420 1162  -0.324  1.0000
##  gad2.714285714 - gad3.285714286   0.0933 0.1400 1162   0.668  1.0000
##  gad2.714285714 - gad3.428571429   0.0438 0.1440 1162   0.305  1.0000
##  gad2.714285714 - gad3.571428571  -0.1111 0.1750 1162  -0.635  1.0000
##  gad2.714285714 - gad3.714285714  -0.2948 0.1680 1162  -1.755  0.9811
##  gad2.714285714 - gad3.857142857  -0.4545 0.1940 1162  -2.341  0.7502
##  gad2.714285714 - gad4            -0.3069 0.1230 1162  -2.504  0.6290
##  gad2.857142857 - gad3             0.2025 0.1520 1162   1.334  0.9995
##  gad2.857142857 - gad3.142857143   0.0786 0.1530 1162   0.513  1.0000
##  gad2.857142857 - gad3.285714286   0.2180 0.1510 1162   1.448  0.9984
##  gad2.857142857 - gad3.428571429   0.1685 0.1540 1162   1.091  1.0000
##  gad2.857142857 - gad3.571428571   0.0136 0.1840 1162   0.074  1.0000
##  gad2.857142857 - gad3.714285714  -0.1701 0.1770 1162  -0.960  1.0000
##  gad2.857142857 - gad3.857142857  -0.3298 0.2020 1162  -1.631  0.9921
##  gad2.857142857 - gad4            -0.1822 0.1350 1162  -1.350  0.9994
##  gad3 - gad3.142857143            -0.1240 0.1570 1162  -0.787  1.0000
##  gad3 - gad3.285714286             0.0155 0.1550 1162   0.100  1.0000
##  gad3 - gad3.428571429            -0.0340 0.1590 1162  -0.214  1.0000
##  gad3 - gad3.571428571            -0.1889 0.1880 1162  -1.007  1.0000
##  gad3 - gad3.714285714            -0.3726 0.1810 1162  -2.059  0.9059
##  gad3 - gad3.857142857            -0.5323 0.2060 1162  -2.590  0.5611
##  gad3 - gad4                      -0.3848 0.1400 1162  -2.751  0.4353
##  gad3.142857143 - gad3.285714286   0.1395 0.1560 1162   0.892  1.0000
##  gad3.142857143 - gad3.428571429   0.0900 0.1600 1162   0.562  1.0000
##  gad3.142857143 - gad3.571428571  -0.0649 0.1890 1162  -0.344  1.0000
##  gad3.142857143 - gad3.714285714  -0.2486 0.1820 1162  -1.366  0.9993
##  gad3.142857143 - gad3.857142857  -0.4083 0.2060 1162  -1.978  0.9347
##  gad3.142857143 - gad4            -0.2608 0.1410 1162  -1.846  0.9672
##  gad3.285714286 - gad3.428571429  -0.0495 0.1580 1162  -0.314  1.0000
##  gad3.285714286 - gad3.571428571  -0.2044 0.1870 1162  -1.096  1.0000
##  gad3.285714286 - gad3.714285714  -0.3881 0.1800 1162  -2.157  0.8616
##  gad3.285714286 - gad3.857142857  -0.5478 0.2050 1162  -2.677  0.4921
##  gad3.285714286 - gad4            -0.4002 0.1390 1162  -2.889  0.3357
##  gad3.428571429 - gad3.571428571  -0.1549 0.1900 1162  -0.817  1.0000
##  gad3.428571429 - gad3.714285714  -0.3386 0.1830 1162  -1.848  0.9668
##  gad3.428571429 - gad3.857142857  -0.4983 0.2070 1162  -2.402  0.7071
##  gad3.428571429 - gad4            -0.3507 0.1430 1162  -2.457  0.6658
##  gad3.571428571 - gad3.714285714  -0.1837 0.2090 1162  -0.881  1.0000
##  gad3.571428571 - gad3.857142857  -0.3434 0.2300 1162  -1.492  0.9975
##  gad3.571428571 - gad4            -0.1958 0.1740 1162  -1.124  1.0000
##  gad3.714285714 - gad3.857142857  -0.1597 0.2250 1162  -0.710  1.0000
##  gad3.714285714 - gad4            -0.0121 0.1670 1162  -0.073  1.0000
##  gad3.857142857 - gad4             0.1476 0.1930 1162   0.763  1.0000
## 
## P value adjustment: tukey method for comparing a family of 22 estimates

9 Write Up Results

9.1 One-Way ANOVA

To test our hypothesis that there would be a significant effect of general anxiety symptoms on people’s pandemic anciety, we used a one-way ANOVA. We identified and removed a single outlier following visual analysis of Cook’s Distance and Residuals VS Leverage plots. >>>> A significant Levene’s test (p = .1193) also indicates that our data violates the assumption of homogeneity of variance. This suggests that there is an increased chance of Type I error. We continued with our analysis for the purpose of this class.

We found a significant effect of general anxiety disorder symptoms, F(21, 1162) = 10.88, p < .001, ηp2 = .16 (large effect size; Cohen, 1988). Posthoc tests using Sidak’s adjustment revealed that participants who own a dog (M = 2.97, SE = .03) reported more companionship than those who own a cat (M = 2.06, SE = .07) but less companionship than those who own a rabbit (M = 3.79, SE = .16); participants who own a rabbit reported the highest amount of companionship overall (see Figure 1 for a comparison).

  • η^2 < 0.01 indicates a trivial effect
  • η^2 >= 0.01 indicates a small effect
  • η^2 >= 0.06 indicates a medium effect
  • η^2 >= 0.14 indicates a large effect

References

Cohen J. (1988). Statistical Power Analysis for the Behavioral Sciences. New York, NY: Routledge Academic.