if (!require(haven)){
install.packages("haven", dependencies = TRUE)
require(haven)
}Loading required package: haven
if (!require(haven)){
install.packages("haven", dependencies = TRUE)
require(haven)
}Loading required package: haven
if (!require(summarytools)){
install.packages("summarytools", dependencies = TRUE)
require(summarytools)
}Loading required package: summarytools
Warning in fun(libname, pkgname): couldn't connect to display ":0"
system might not have X11 capabilities; in case of errors when using dfSummary(), set st_options(use.x11 = FALSE)
if (!require(tidyverse)){
install.packages("tidyverse", dependencies = TRUE)
require(tidyverse)
}Loading required package: tidyverse
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.4.4 ✔ tibble 3.2.1
✔ lubridate 1.9.3 ✔ tidyr 1.3.0
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
✖ tibble::view() masks summarytools::view()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
if (!require(psych)){
install.packages("psych", dependencies = TRUE)
require(psych)
}Loading required package: psych
Attaching package: 'psych'
The following objects are masked from 'package:ggplot2':
%+%, alpha
if (!require(afex)){
install.packages("afex", dependencies = TRUE)
library(afex)
}Loading required package: afex
Loading required package: lme4
Loading required package: Matrix
Attaching package: 'Matrix'
The following objects are masked from 'package:tidyr':
expand, pack, unpack
************
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
##Import Data
dataset <- read_sav("Social+Ospreys+Survey_April+12,+2024_10.37.sav")dataset %>%
filter(Duration__in_seconds_ > 120) %>%
mutate(age_as_a_number = as.numeric(Age)) -> dataset.clean(dataset.clean %>%
mutate(activityIV = case_when(FL_11_DO_ExerciseLessThanaMinute == 1 ~ "Exercise",
FL_11_DO_ReadingLessThanaMinute == 1 ~ "Reading",
FL_11_DO_ExerciseMoreThanaMinute == 1 ~ "Exercise",
FL_11_DO_ReadingMoreThanaMinute == 1 ~ "Reading")) -> dataset.clean)# A tibble: 31 × 32
StartDate EndDate Status IPAddress Progress
<dttm> <dttm> <dbl+lbl> <chr> <dbl>
1 2024-04-03 12:24:34 2024-04-03 12:28:03 0 [IP Address] 38.91.106.87 100
2 2024-04-03 13:17:39 2024-04-03 13:20:13 0 [IP Address] 72.209.71.16 100
3 2024-04-03 13:18:46 2024-04-03 13:21:05 0 [IP Address] 72.196.114.4 100
4 2024-04-03 13:17:43 2024-04-03 13:22:18 0 [IP Address] 139.62.222.65 100
5 2024-04-03 13:40:51 2024-04-03 13:43:14 0 [IP Address] 172.59.66.164 100
6 2024-04-03 13:21:13 2024-04-03 13:48:35 0 [IP Address] 85.76.116.117 100
7 2024-04-03 12:58:01 2024-04-03 13:50:23 0 [IP Address] 24.7.113.89 100
8 2024-04-03 13:58:25 2024-04-03 14:00:55 0 [IP Address] 172.59.67.240 100
9 2024-04-03 14:06:05 2024-04-03 14:08:42 0 [IP Address] 199.44.92.17 100
10 2024-04-03 15:11:12 2024-04-03 15:14:53 0 [IP Address] 162.229.230.… 100
# ℹ 21 more rows
# ℹ 27 more variables: Duration__in_seconds_ <dbl>, Finished <dbl+lbl>,
# RecordedDate <dttm>, ResponseId <chr>, RecipientLastName <chr>,
# RecipientFirstName <chr>, RecipientEmail <chr>, ExternalReference <chr>,
# LocationLatitude <chr>, LocationLongitude <chr>, DistributionChannel <chr>,
# UserLanguage <chr>, Q_RecaptchaScore <dbl>, Informed_consent <dbl+lbl>,
# Anxiety1 <dbl+lbl>, Anxiety2 <dbl+lbl>, Anxiety3 <dbl+lbl>, Gender <chr>, …
(dataset.clean %>%
mutate(durationIV = case_when(FL_11_DO_ExerciseLessThanaMinute == 1 ~ "short",
FL_11_DO_ReadingLessThanaMinute == 1 ~ "short",
FL_11_DO_ExerciseMoreThanaMinute == 1 ~ "long",
FL_11_DO_ReadingMoreThanaMinute == 1 ~ "long")) -> dataset.clean)# A tibble: 31 × 33
StartDate EndDate Status IPAddress Progress
<dttm> <dttm> <dbl+lbl> <chr> <dbl>
1 2024-04-03 12:24:34 2024-04-03 12:28:03 0 [IP Address] 38.91.106.87 100
2 2024-04-03 13:17:39 2024-04-03 13:20:13 0 [IP Address] 72.209.71.16 100
3 2024-04-03 13:18:46 2024-04-03 13:21:05 0 [IP Address] 72.196.114.4 100
4 2024-04-03 13:17:43 2024-04-03 13:22:18 0 [IP Address] 139.62.222.65 100
5 2024-04-03 13:40:51 2024-04-03 13:43:14 0 [IP Address] 172.59.66.164 100
6 2024-04-03 13:21:13 2024-04-03 13:48:35 0 [IP Address] 85.76.116.117 100
7 2024-04-03 12:58:01 2024-04-03 13:50:23 0 [IP Address] 24.7.113.89 100
8 2024-04-03 13:58:25 2024-04-03 14:00:55 0 [IP Address] 172.59.67.240 100
9 2024-04-03 14:06:05 2024-04-03 14:08:42 0 [IP Address] 199.44.92.17 100
10 2024-04-03 15:11:12 2024-04-03 15:14:53 0 [IP Address] 162.229.230.… 100
# ℹ 21 more rows
# ℹ 28 more variables: Duration__in_seconds_ <dbl>, Finished <dbl+lbl>,
# RecordedDate <dttm>, ResponseId <chr>, RecipientLastName <chr>,
# RecipientFirstName <chr>, RecipientEmail <chr>, ExternalReference <chr>,
# LocationLatitude <chr>, LocationLongitude <chr>, DistributionChannel <chr>,
# UserLanguage <chr>, Q_RecaptchaScore <dbl>, Informed_consent <dbl+lbl>,
# Anxiety1 <dbl+lbl>, Anxiety2 <dbl+lbl>, Anxiety3 <dbl+lbl>, Gender <chr>, …
Anxiety <- data.frame (dataset.clean$Anxiety1, dataset.clean$Anxiety2, dataset.clean$Anxiety3)
#create dataframe with only relevant variables to work with
Anxiety.keys <- make.keys(Anxiety, list(Anxiety=c(1,2,3)))
#score the scale
Anxiety.scales <- scoreItems (Anxiety.keys, Anxiety)
#save the scores
Anxiety.scores <- Anxiety.scales$scores
#save the scores back in 'dataset'
dataset.clean$Anxiety <- Anxiety.scores[,]
#print the cronbach alpha
Anxiety.scales$alpha Anxiety
alpha 0.9067193
aov_ez(id = "ResponseId",
dv = "Anxiety",
data = dataset.clean,
between=c("durationIV", "activityIV"),
anova_table = list(es = "pes"))Converting to factor: durationIV, activityIV
Contrasts set to contr.sum for the following variables: durationIV, activityIV
Anova Table (Type 3 tests)
Response: Anxiety
Effect df MSE F pes p.value
1 durationIV 1, 27 1.77 0.30 .011 .586
2 activityIV 1, 27 1.77 2.30 .079 .141
3 durationIV:activityIV 1, 27 1.77 2.08 .072 .160
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Marginal means for Duration
dataset.clean %>%
group_by(durationIV) %>%
summarise(m = mean(Anxiety),
sd = sd(Anxiety))# A tibble: 2 × 3
durationIV m sd
<chr> <dbl> <dbl>
1 long 2.63 1.61
2 short 2.69 1.07
Marginal means for Activity
dataset.clean %>%
group_by(activityIV) %>%
summarise(m = mean(Anxiety),
sd = sd(Anxiety))# A tibble: 2 × 3
activityIV m sd
<chr> <dbl> <dbl>
1 Exercise 2.12 1.10
2 Reading 2.95 1.44
Cell Means (inside of the study design table)
dataset.clean %>%
group_by(durationIV, activityIV) %>%
summarise(m = mean(Anxiety),
sd = sd(Anxiety))`summarise()` has grouped output by 'durationIV'. You can override using the
`.groups` argument.
# A tibble: 4 × 4
# Groups: durationIV [2]
durationIV activityIV m sd
<chr> <chr> <dbl> <dbl>
1 long Exercise 1.67 0.760
2 long Reading 3.15 1.73
3 short Exercise 2.67 1.27
4 short Reading 2.70 1.02
print(dfSummary(dataset.clean, graph.magnif = .75), method = 'render')Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
Warning in png(png_loc <- tempfile(fileext = ".png"), width = 150 *
graph.magnif, : unable to open connection to X11 display ''
| No | Variable | Label | Stats / Values | Freqs (% of Valid) | Graph | Valid | Missing | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | StartDate [POSIXct, POSIXt] | Start Date |
|
31 distinct values | 31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | EndDate [POSIXct, POSIXt] | End Date |
|
31 distinct values | 31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | Status [haven_labelled, vctrs_vctr, double] | Response Type | 1 distinct value |
|
31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | IPAddress [character] | IP Address |
|
|
31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | Progress [numeric] | Progress |
|
|
31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | Duration__in_seconds_ [numeric] | Duration (in seconds) |
|
30 distinct values | 31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | Finished [haven_labelled, vctrs_vctr, double] | Finished |
|
|
31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | RecordedDate [POSIXct, POSIXt] | Recorded Date |
|
31 distinct values | 31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | ResponseId [character] | Response ID |
|
|
31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | RecipientLastName [character] | Recipient Last Name |
|
31 (100.0%) | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | RecipientFirstName [character] | Recipient First Name |
|
31 (100.0%) | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | RecipientEmail [character] | Recipient Email |
|
31 (100.0%) | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | ExternalReference [character] | External Data Reference |
|
31 (100.0%) | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | LocationLatitude [character] | Location Latitude |
|
|
31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | LocationLongitude [character] | Location Longitude |
|
|
31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | DistributionChannel [character] | Distribution Channel | 1. anonymous |
|
31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | UserLanguage [character] | User Language | 1. EN |
|
31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | Q_RecaptchaScore [numeric] | Q_RecaptchaScore |
|
|
31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | Informed_consent [haven_labelled, vctrs_vctr, double] | Informed Consent University of North Florida Department of Psychological Sciences Purpose of Research and Specific procedures to be used: In this study, you will be asked to complete a short activity and answer some questions afterwards. It should take approximately 5 minutes to complete. All answers will remain anonymous. Please answer the questions to the best of your ability. There are no right or wrong answers. Duration of Participation: Your participation should take 5 minutes. Benefits to the Individual: Your participation in this research will contribute to the body of psychological knowledge about anxiety. You will have the opportunity to gain a deeper understanding of psychological research. In addition, you will receive information about anxiety at the end of this study. Risks to the Individual: This study poses no risks greater than those encountered in daily life. Anonymity: Strict anonymity of all data will be upheld. Your responses will remain anonymous and will not be associated with | 1 distinct value |
|
31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | Anxiety1 [haven_labelled, vctrs_vctr, double] | This activity gave me anxiety. |
|
|
31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | Anxiety2 [haven_labelled, vctrs_vctr, double] | I felt nervous during this activity. |
|
|
31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | Anxiety3 [haven_labelled, vctrs_vctr, double] | During this experience, I had feelings of worry. |
|
|
31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | Gender [character] | What is your gender? |
|
|
31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | Race [character] | What is your race? |
|
|
31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | Age [character] | What is your age? (18+) |
|
|
31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | Hypothesis [character] | What do you think the hypothesis of our study is? |
|
|
31 (100.0%) | 0 (0.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | FL_11_DO_ExerciseLessThanaMinute [numeric] | FL_11 - Block Randomizer - Display Order ExerciseLessThanaMinute | 1 distinct value |
|
5 (16.1%) | 26 (83.9%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | FL_11_DO_ReadingLessThanaMinute [numeric] | FL_11 - Block Randomizer - Display Order ReadingLessThanaMinute | 1 distinct value |
|
9 (29.0%) | 22 (71.0%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | FL_11_DO_ExerciseMoreThanaMinute [numeric] | FL_11 - Block Randomizer - Display Order ExerciseMoreThanaMinute | 1 distinct value |
|
6 (19.4%) | 25 (80.6%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | FL_11_DO_ReadingMoreThanaMinute [numeric] | FL_11 - Block Randomizer - Display Order ReadingMoreThanaMinute | 1 distinct value |
|
11 (35.5%) | 20 (64.5%) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | age_as_a_number [numeric] |
|
19 distinct values | 31 (100.0%) | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | activityIV [character] |
|
|
31 (100.0%) | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | durationIV [character] |
|
|
31 (100.0%) | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | Anxiety [numeric] |
|
14 distinct values | 31 (100.0%) | 0 (0.0%) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Generated by summarytools 1.0.1 (R version 4.3.3)
2024-04-15