Group Analysis Analysis BNN

load packages

if (!require(haven)){
  install.packages("haven", dependencies = TRUE)
  require(haven)
}
Loading required package: haven
if (!require(tidyverse)){
  install.packages("tidyverse", dependencies = TRUE)
  require(tidyverse)
}
Loading required package: tidyverse
── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
✔ ggplot2 3.4.0      ✔ purrr   1.0.1 
✔ tibble  3.1.8      ✔ dplyr   1.0.10
✔ tidyr   1.2.1      ✔ stringr 1.5.0 
✔ readr   2.1.3      ✔ forcats 0.5.2 
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
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)

Attaching package: 'summarytools'
The following object is masked from 'package:tibble':

    view
if (!require(afex)){
  install.packages("afex", dependencies = TRUE)
  require(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
- NEWS: emmeans() for ANOVA models now uses model = 'multivariate' as default.
- Get and set global package options with: afex_options()
- Set orthogonal 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
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

Import data

dataset <- read_sav("BNN Data.sav.sav")

Clean data

(dataset %>%
  filter(Duration__in_seconds_ > 130)-> dataset.clean)
# A tibble: 21 × 55
   StartDate           EndDate             Status        IPAdd…¹ Progr…² Durat…³
   <dttm>              <dttm>              <dbl+lbl>     <chr>     <dbl>   <dbl>
 1 2023-04-05 14:30:49 2023-04-05 14:34:12 0 [IP Addres… 107.77…     100     203
 2 2023-04-05 15:14:46 2023-04-05 15:20:35 0 [IP Addres… 73.173…     100     348
 3 2023-04-05 15:38:24 2023-04-05 15:41:12 0 [IP Addres… 174.21…     100     168
 4 2023-04-05 23:43:00 2023-04-05 23:49:24 0 [IP Addres… 99.145…     100     383
 5 2023-04-05 17:23:51 2023-04-05 17:27:50 0 [IP Addres… 73.42.…      98     238
 6 2023-04-19 12:00:46 2023-04-19 12:06:40 0 [IP Addres… 172.59…     100     354
 7 2023-04-19 13:12:24 2023-04-19 13:16:35 0 [IP Addres… 139.62…     100     250
 8 2023-04-19 13:18:09 2023-04-19 13:22:12 0 [IP Addres… 139.62…     100     242
 9 2023-04-19 14:01:52 2023-04-19 14:05:56 0 [IP Addres… 96.90.…     100     243
10 2023-04-19 15:59:09 2023-04-19 16:01:28 0 [IP Addres… 139.62…     100     138
# … with 11 more rows, 49 more variables: Finished <dbl+lbl>,
#   RecordedDate <dttm>, ResponseId <chr>, RecipientLastName <chr>,
#   RecipientFirstName <chr>, RecipientEmail <chr>, ExternalReference <chr>,
#   LocationLatitude <chr>, LocationLongitude <chr>, DistributionChannel <chr>,
#   UserLanguage <chr>, Consent_Response <dbl+lbl>, Happiness_1 <dbl+lbl>,
#   Happiness_2 <dbl+lbl>, Happiness_3 <dbl+lbl>, Happiness_4 <dbl+lbl>,
#   Happiness_5 <dbl+lbl>, Happiness_6 <dbl+lbl>, Happiness_7 <dbl+lbl>, …

Method section numbers

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 ''

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 ''

Data Frame Summary

dataset.clean

Dimensions: 21 x 55
Duplicates: 0
No Variable Label Stats / Values Freqs (% of Valid) Graph Valid Missing
1 StartDate [POSIXct, POSIXt] Start Date
min : 2023-04-05 14:30:49
med : 2023-04-19 17:58:24
max : 2023-04-24 16:41:37
range : 19d 2H 10M 48S
21 distinct values 21 (100.0%) 0 (0.0%)
2 EndDate [POSIXct, POSIXt] End Date
min : 2023-04-05 14:34:12
med : 2023-04-19 18:01:32
max : 2023-04-24 16:45:50
range : 19d 2H 11M 38S
21 distinct values 21 (100.0%) 0 (0.0%)
3 Status [haven_labelled, vctrs_vctr, double] Response Type 1 distinct value
0:21(100.0%)
21 (100.0%) 0 (0.0%)
4 IPAddress [character] IP Address
1. 104.1.222.92
2. 107.77.216.208
3. 108.84.240.226
4. 139.62.222.166
5. 139.62.222.170
6. 139.62.222.36
7. 139.62.222.85
8. 139.62.223.110
9. 172.58.172.204
10. 172.58.175.134
[ 11 others ]
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
11(52.4%)
21 (100.0%) 0 (0.0%)
5 Progress [numeric] Progress
Min : 98
Mean : 99.9
Max : 100
98:1(4.8%)
100:20(95.2%)
21 (100.0%) 0 (0.0%)
6 Duration__in_seconds_ [numeric] Duration (in seconds)
Mean (sd) : 2396.9 (9823.8)
min ≤ med ≤ max:
138 ≤ 242 ≤ 45270
IQR (CV) : 154 (4.1)
21 distinct values 21 (100.0%) 0 (0.0%)
7 Finished [haven_labelled, vctrs_vctr, double] Finished
Min : 0
Mean : 1
Max : 1
0:1(4.8%)
1:20(95.2%)
21 (100.0%) 0 (0.0%)
8 RecordedDate [POSIXct, POSIXt] Recorded Date
min : 2023-04-05 14:34:12
med : 2023-04-19 18:01:33
max : 2023-04-24 16:45:51
range : 19d 2H 11M 39S
21 distinct values 21 (100.0%) 0 (0.0%)
9 ResponseId [character] Response ID
1. R_0DRv1pYE4wYsbPr
2. R_1dHnY22h2nq4a3V
3. R_1l43s6MwE3xdqiY
4. R_1LG60cs1aNOgiBe
5. R_1mKQIH9jkh8K2Ye
6. R_27yFeX3dB8pT1CJ
7. R_2bTMhHATN6f2nsz
8. R_2CcTUaG2ox2Yjf0
9. R_2EcTcUpoMda3Ew0
10. R_2ScOkWJ6KORUDp8
[ 11 others ]
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
11(52.4%)
21 (100.0%) 0 (0.0%)
10 RecipientLastName [character] Recipient Last Name
All empty strings
21 (100.0%) 0 (0.0%)
11 RecipientFirstName [character] Recipient First Name
All empty strings
21 (100.0%) 0 (0.0%)
12 RecipientEmail [character] Recipient Email
All empty strings
21 (100.0%) 0 (0.0%)
13 ExternalReference [character] External Data Reference
All empty strings
21 (100.0%) 0 (0.0%)
14 LocationLatitude [character] Location Latitude
1. 30.3341
2. 30.3209
3. (Empty string)
4. 25.9289
5. 28.1822
6. 28.4883
7. 28.5464
8. 28.6344
9. 30.2755
10. 30.2884
[ 7 others ]
4(19.0%)
2(9.5%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
7(33.3%)
21 (100.0%) 0 (0.0%)
15 LocationLongitude [character] Location Longitude
1. -81.6544
2. -81.6829
3. (Empty string)
4. -1.8524
5. -110.8237
6. -77.3393
7. -79.7839
8. -80.1827
9. -80.6117
10. -81.2585
[ 7 others ]
4(19.0%)
2(9.5%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
7(33.3%)
21 (100.0%) 0 (0.0%)
16 DistributionChannel [character] Distribution Channel 1. anonymous
21(100.0%)
21 (100.0%) 0 (0.0%)
17 UserLanguage [character] User Language 1. EN
21(100.0%)
21 (100.0%) 0 (0.0%)
18 Consent_Response [haven_labelled, vctrs_vctr, double] Click to write the question text 1 distinct value
1:21(100.0%)
21 (100.0%) 0 (0.0%)
19 Happiness_1 [haven_labelled, vctrs_vctr, double] I don't feel particularly pleased with the way I am.
Mean (sd) : 3.4 (1.8)
min ≤ med ≤ max:
1 ≤ 3 ≤ 6
IQR (CV) : 3 (0.5)
1:4(19.0%)
2:4(19.0%)
3:3(14.3%)
4:3(14.3%)
5:4(19.0%)
6:3(14.3%)
21 (100.0%) 0 (0.0%)
20 Happiness_2 [haven_labelled, vctrs_vctr, double] I am intensely interested in other people.
Mean (sd) : 4.4 (1.2)
min ≤ med ≤ max:
2 ≤ 5 ≤ 6
IQR (CV) : 1 (0.3)
2:2(9.5%)
3:3(14.3%)
4:3(14.3%)
5:11(52.4%)
6:2(9.5%)
21 (100.0%) 0 (0.0%)
21 Happiness_3 [haven_labelled, vctrs_vctr, double] I feel that life is very rewarding.
Mean (sd) : 4.7 (1.1)
min ≤ med ≤ max:
2 ≤ 5 ≤ 6
IQR (CV) : 1 (0.2)
2:1(4.8%)
3:2(9.5%)
4:5(23.8%)
5:8(38.1%)
6:5(23.8%)
21 (100.0%) 0 (0.0%)
22 Happiness_4 [haven_labelled, vctrs_vctr, double] I have very warm feelings towards almost everyone
Mean (sd) : 3.7 (1.3)
min ≤ med ≤ max:
2 ≤ 3 ≤ 6
IQR (CV) : 2 (0.4)
2:4(19.0%)
3:7(33.3%)
4:4(19.0%)
5:3(14.3%)
6:3(14.3%)
21 (100.0%) 0 (0.0%)
23 Happiness_5 [haven_labelled, vctrs_vctr, double] I rarely wake up feeling rested.
Mean (sd) : 3.9 (1.4)
min ≤ med ≤ max:
1 ≤ 4 ≤ 6
IQR (CV) : 2 (0.4)
1:1(4.8%)
2:4(19.0%)
3:2(9.5%)
4:5(23.8%)
5:7(33.3%)
6:2(9.5%)
21 (100.0%) 0 (0.0%)
24 Happiness_6 [haven_labelled, vctrs_vctr, double] I am not particularly optimistic about the future.
Mean (sd) : 3.1 (1.6)
min ≤ med ≤ max:
1 ≤ 3 ≤ 6
IQR (CV) : 2 (0.5)
1:4(19.0%)
2:4(19.0%)
3:4(19.0%)
4:4(19.0%)
5:4(19.0%)
6:1(4.8%)
21 (100.0%) 0 (0.0%)
25 Happiness_7 [haven_labelled, vctrs_vctr, double] I find most things amusing.
Mean (sd) : 4.2 (1.1)
min ≤ med ≤ max:
2 ≤ 4 ≤ 6
IQR (CV) : 1 (0.3)
2:2(9.5%)
3:1(4.8%)
4:12(57.1%)
5:2(9.5%)
6:4(19.0%)
21 (100.0%) 0 (0.0%)
26 Happiness_8 [haven_labelled, vctrs_vctr, double] I am always committed and involved.
Mean (sd) : 4.4 (1.1)
min ≤ med ≤ max:
2 ≤ 4 ≤ 6
IQR (CV) : 1 (0.2)
2:1(4.8%)
3:2(9.5%)
4:10(47.6%)
5:4(19.0%)
6:4(19.0%)
21 (100.0%) 0 (0.0%)
27 Happiness_9 [haven_labelled, vctrs_vctr, double] Life is good.
Mean (sd) : 4.5 (1.2)
min ≤ med ≤ max:
2 ≤ 5 ≤ 6
IQR (CV) : 1 (0.3)
2:2(9.5%)
3:2(9.5%)
4:6(28.6%)
5:6(28.6%)
6:5(23.8%)
21 (100.0%) 0 (0.0%)
28 Happiness_10 [haven_labelled, vctrs_vctr, double] I do no think that the world is a good place.
Mean (sd) : 3.6 (1.1)
min ≤ med ≤ max:
2 ≤ 4 ≤ 6
IQR (CV) : 1 (0.3)
2:4(19.0%)
3:6(28.6%)
4:7(33.3%)
5:3(14.3%)
6:1(4.8%)
21 (100.0%) 0 (0.0%)
29 Happiness_11 [haven_labelled, vctrs_vctr, double] I laugh a lot.
Mean (sd) : 4.8 (1.2)
min ≤ med ≤ max:
2 ≤ 5 ≤ 6
IQR (CV) : 2 (0.2)
2:1(4.8%)
3:1(4.8%)
4:7(33.3%)
5:4(19.0%)
6:8(38.1%)
21 (100.0%) 0 (0.0%)
30 Happiness_12 [haven_labelled, vctrs_vctr, double] I am well satisfied about everything in my life.
Mean (sd) : 3.9 (1.3)
min ≤ med ≤ max:
1 ≤ 4 ≤ 6
IQR (CV) : 2 (0.3)
1:1(4.8%)
2:2(9.5%)
3:4(19.0%)
4:6(28.6%)
5:7(33.3%)
6:1(4.8%)
21 (100.0%) 0 (0.0%)
31 Happiness_13 [haven_labelled, vctrs_vctr, double] I don't think I look attractive.
Mean (sd) : 2.6 (1.6)
min ≤ med ≤ max:
1 ≤ 2 ≤ 6
IQR (CV) : 3 (0.6)
1:7(33.3%)
2:6(28.6%)
3:2(9.5%)
4:2(9.5%)
5:3(14.3%)
6:1(4.8%)
21 (100.0%) 0 (0.0%)
32 Happiness_14 [haven_labelled, vctrs_vctr, double] There is a gap between what I would like to do and what I have done.
Mean (sd) : 4.1 (1.6)
min ≤ med ≤ max:
1 ≤ 4 ≤ 6
IQR (CV) : 3 (0.4)
1:1(4.8%)
2:2(9.5%)
3:6(28.6%)
4:3(14.3%)
5:3(14.3%)
6:6(28.6%)
21 (100.0%) 0 (0.0%)
33 Happiness_15 [haven_labelled, vctrs_vctr, double] I am very happy.
Mean (sd) : 4.3 (1.5)
min ≤ med ≤ max:
1 ≤ 5 ≤ 6
IQR (CV) : 2 (0.3)
1:1(4.8%)
2:1(4.8%)
3:6(28.6%)
5:9(42.9%)
6:4(19.0%)
21 (100.0%) 0 (0.0%)
34 Happiness_16 [haven_labelled, vctrs_vctr, double] I find beauty in some things.
Mean (sd) : 5.3 (0.7)
min ≤ med ≤ max:
4 ≤ 5 ≤ 6
IQR (CV) : 1 (0.1)
4:3(14.3%)
5:9(42.9%)
6:9(42.9%)
21 (100.0%) 0 (0.0%)
35 Happiness_17 [haven_labelled, vctrs_vctr, double] I always have a cheerful effect on others.
Mean (sd) : 4.4 (0.9)
min ≤ med ≤ max:
2 ≤ 4 ≤ 6
IQR (CV) : 1 (0.2)
2:1(4.8%)
4:12(57.1%)
5:5(23.8%)
6:3(14.3%)
21 (100.0%) 0 (0.0%)
36 Happiness_18 [haven_labelled, vctrs_vctr, double] I can fit in (find time for) everything I want to.
Mean (sd) : 3.6 (1.6)
min ≤ med ≤ max:
1 ≤ 3 ≤ 6
IQR (CV) : 3 (0.4)
1:1(4.8%)
2:5(23.8%)
3:6(28.6%)
4:2(9.5%)
5:3(14.3%)
6:4(19.0%)
21 (100.0%) 0 (0.0%)
37 Happiness_19 [haven_labelled, vctrs_vctr, double] I feel that I am not especially in control of my life.
Mean (sd) : 3.7 (1.3)
min ≤ med ≤ max:
1 ≤ 4 ≤ 6
IQR (CV) : 1 (0.3)
1:1(4.8%)
2:3(14.3%)
3:3(14.3%)
4:10(47.6%)
5:2(9.5%)
6:2(9.5%)
21 (100.0%) 0 (0.0%)
38 Happiness_20 [haven_labelled, vctrs_vctr, double] I feel able to take anything on.
Mean (sd) : 4 (1.2)
min ≤ med ≤ max:
1 ≤ 4 ≤ 6
IQR (CV) : 2 (0.3)
1:1(4.8%)
3:7(33.3%)
4:6(28.6%)
5:5(23.8%)
6:2(9.5%)
21 (100.0%) 0 (0.0%)
39 Happiness_21 [haven_labelled, vctrs_vctr, double] I feel fully mentally alert.
Mean (sd) : 3.3 (1.5)
min ≤ med ≤ max:
1 ≤ 3 ≤ 6
IQR (CV) : 3 (0.5)
1:3(14.3%)
2:4(19.0%)
3:4(19.0%)
4:4(19.0%)
5:5(23.8%)
6:1(4.8%)
21 (100.0%) 0 (0.0%)
40 Happiness_22 [haven_labelled, vctrs_vctr, double] I often enjoy experience joy and elation.
Mean (sd) : 4.6 (1.2)
min ≤ med ≤ max:
2 ≤ 5 ≤ 6
IQR (CV) : 1 (0.3)
2:2(9.5%)
3:1(4.8%)
4:6(28.6%)
5:7(33.3%)
6:5(23.8%)
21 (100.0%) 0 (0.0%)
41 Happiness_23 [haven_labelled, vctrs_vctr, double] I don't find it easy to make decisions.
Mean (sd) : 4.4 (1.3)
min ≤ med ≤ max:
2 ≤ 5 ≤ 6
IQR (CV) : 2 (0.3)
2:2(9.5%)
3:4(19.0%)
4:3(14.3%)
5:7(33.3%)
6:5(23.8%)
21 (100.0%) 0 (0.0%)
42 Happiness_24 [haven_labelled, vctrs_vctr, double] I don't have a particular sense of meaning and purpose in my life.
Mean (sd) : 2.6 (1.4)
min ≤ med ≤ max:
1 ≤ 3 ≤ 5
IQR (CV) : 3 (0.5)
1:7(33.3%)
2:3(14.3%)
3:4(19.0%)
4:5(23.8%)
5:2(9.5%)
21 (100.0%) 0 (0.0%)
43 Happiness_25 [haven_labelled, vctrs_vctr, double] I feel I have a great deal of energy.
Mean (sd) : 3.6 (1.5)
min ≤ med ≤ max:
1 ≤ 4 ≤ 6
IQR (CV) : 1 (0.4)
1:3(14.3%)
2:1(4.8%)
3:6(28.6%)
4:6(28.6%)
5:2(9.5%)
6:3(14.3%)
21 (100.0%) 0 (0.0%)
44 Happiness_26 [haven_labelled, vctrs_vctr, double] I usually don't have a good influence on events.
Mean (sd) : 2.6 (0.9)
min ≤ med ≤ max:
1 ≤ 3 ≤ 4
IQR (CV) : 1 (0.4)
1:3(14.3%)
2:6(28.6%)
3:9(42.9%)
4:3(14.3%)
21 (100.0%) 0 (0.0%)
45 Happiness_27 [haven_labelled, vctrs_vctr, double] I don't have fun with other people.
Mean (sd) : 2.3 (1.1)
min ≤ med ≤ max:
1 ≤ 2 ≤ 4
IQR (CV) : 2 (0.5)
1:6(28.6%)
2:6(28.6%)
3:6(28.6%)
4:3(14.3%)
21 (100.0%) 0 (0.0%)
46 Happiness_28 [haven_labelled, vctrs_vctr, double] I don't feel particularly healthy.
Mean (sd) : 3.6 (1.3)
min ≤ med ≤ max:
1 ≤ 4 ≤ 6
IQR (CV) : 1 (0.4)
1:1(4.8%)
2:3(14.3%)
3:6(28.6%)
4:6(28.6%)
5:3(14.3%)
6:2(9.5%)
21 (100.0%) 0 (0.0%)
47 Happiness_29 [haven_labelled, vctrs_vctr, double] I don't have particularly happy memories of that past.
Mean (sd) : 3.2 (1.5)
min ≤ med ≤ max:
1 ≤ 3 ≤ 6
IQR (CV) : 2 (0.5)
1:4(19.0%)
2:3(14.3%)
3:4(19.0%)
4:5(23.8%)
5:4(19.0%)
6:1(4.8%)
21 (100.0%) 0 (0.0%)
48 Gender [character] Which Gender would you say best describes you?
1. female
2. Female
3. Male
4. Man
5. Non binary
3(14.3%)
12(57.1%)
4(19.0%)
1(4.8%)
1(4.8%)
21 (100.0%) 0 (0.0%)
49 Age [numeric] How old are you?
Mean (sd) : 20.5 (1.1)
min ≤ med ≤ max:
18 ≤ 21 ≤ 22
IQR (CV) : 1 (0.1)
18:1(4.8%)
19:3(14.3%)
20:5(23.8%)
21:9(42.9%)
22:3(14.3%)
21 (100.0%) 0 (0.0%)
50 Race [character] What Race would you say best describes you?
1. Black & White
2. Caucasian or white
3. Hispanic
4. Hispanic/Latino
5. mixed
6. Mixed
7. Mixed (White and Black)
8. white
9. White
10. White Latina
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
1(4.8%)
2(9.5%)
11(52.4%)
1(4.8%)
21 (100.0%) 0 (0.0%)
51 Political_StandPoint [haven_labelled, vctrs_vctr, double] Which of the following best describes you?
Mean (sd) : 2.6 (1.6)
min ≤ med ≤ max:
1 ≤ 2 ≤ 5
IQR (CV) : 3 (0.6)
1:7(33.3%)
2:6(28.6%)
3:2(9.5%)
4:1(4.8%)
5:5(23.8%)
21 (100.0%) 0 (0.0%)
52 FL_10_DO_CatPositive [numeric] FL_10 - Block Randomizer - Display Order CatPositive 1 distinct value
1:4(100.0%)
4 (19.0%) 17 (81.0%)
53 FL_10_DO_CatNegative [numeric] FL_10 - Block Randomizer - Display Order CatNegative 1 distinct value
1:5(100.0%)
5 (23.8%) 16 (76.2%)
54 FL_10_DO_DogPositive [numeric] FL_10 - Block Randomizer - Display Order DogPositive 1 distinct value
1:6(100.0%)
6 (28.6%) 15 (71.4%)
55 FL_10_DO_DogNegative [numeric] FL_10 - Block Randomizer - Display Order DogNegative 1 distinct value
1:6(100.0%)
6 (28.6%) 15 (71.4%)

Generated by summarytools 1.0.1 (R version 4.2.2)
2023-04-26

create animal IV

(dataset.clean %>%
  mutate(animalIV = case_when(FL_10_DO_CatNegative == 1 ~ "cat",
                               FL_10_DO_CatPositive == 1 ~ "cat",
                               FL_10_DO_DogNegative == 1 ~ "dog",
                               FL_10_DO_DogPositive == 1 ~ "dog")) -> dataset.clean)
# A tibble: 21 × 56
   StartDate           EndDate             Status        IPAdd…¹ Progr…² Durat…³
   <dttm>              <dttm>              <dbl+lbl>     <chr>     <dbl>   <dbl>
 1 2023-04-05 14:30:49 2023-04-05 14:34:12 0 [IP Addres… 107.77…     100     203
 2 2023-04-05 15:14:46 2023-04-05 15:20:35 0 [IP Addres… 73.173…     100     348
 3 2023-04-05 15:38:24 2023-04-05 15:41:12 0 [IP Addres… 174.21…     100     168
 4 2023-04-05 23:43:00 2023-04-05 23:49:24 0 [IP Addres… 99.145…     100     383
 5 2023-04-05 17:23:51 2023-04-05 17:27:50 0 [IP Addres… 73.42.…      98     238
 6 2023-04-19 12:00:46 2023-04-19 12:06:40 0 [IP Addres… 172.59…     100     354
 7 2023-04-19 13:12:24 2023-04-19 13:16:35 0 [IP Addres… 139.62…     100     250
 8 2023-04-19 13:18:09 2023-04-19 13:22:12 0 [IP Addres… 139.62…     100     242
 9 2023-04-19 14:01:52 2023-04-19 14:05:56 0 [IP Addres… 96.90.…     100     243
10 2023-04-19 15:59:09 2023-04-19 16:01:28 0 [IP Addres… 139.62…     100     138
# … with 11 more rows, 50 more variables: Finished <dbl+lbl>,
#   RecordedDate <dttm>, ResponseId <chr>, RecipientLastName <chr>,
#   RecipientFirstName <chr>, RecipientEmail <chr>, ExternalReference <chr>,
#   LocationLatitude <chr>, LocationLongitude <chr>, DistributionChannel <chr>,
#   UserLanguage <chr>, Consent_Response <dbl+lbl>, Happiness_1 <dbl+lbl>,
#   Happiness_2 <dbl+lbl>, Happiness_3 <dbl+lbl>, Happiness_4 <dbl+lbl>,
#   Happiness_5 <dbl+lbl>, Happiness_6 <dbl+lbl>, Happiness_7 <dbl+lbl>, …

create valence IV

(dataset.clean %>%
  mutate(valenceIV = case_when(FL_10_DO_CatNegative == 1 ~ "negative",
                               FL_10_DO_CatPositive == 1 ~ "positive",
                               FL_10_DO_DogNegative == 1 ~ "negative",
                               FL_10_DO_DogPositive == 1 ~ "positive")) -> dataset.clean)
# A tibble: 21 × 57
   StartDate           EndDate             Status        IPAdd…¹ Progr…² Durat…³
   <dttm>              <dttm>              <dbl+lbl>     <chr>     <dbl>   <dbl>
 1 2023-04-05 14:30:49 2023-04-05 14:34:12 0 [IP Addres… 107.77…     100     203
 2 2023-04-05 15:14:46 2023-04-05 15:20:35 0 [IP Addres… 73.173…     100     348
 3 2023-04-05 15:38:24 2023-04-05 15:41:12 0 [IP Addres… 174.21…     100     168
 4 2023-04-05 23:43:00 2023-04-05 23:49:24 0 [IP Addres… 99.145…     100     383
 5 2023-04-05 17:23:51 2023-04-05 17:27:50 0 [IP Addres… 73.42.…      98     238
 6 2023-04-19 12:00:46 2023-04-19 12:06:40 0 [IP Addres… 172.59…     100     354
 7 2023-04-19 13:12:24 2023-04-19 13:16:35 0 [IP Addres… 139.62…     100     250
 8 2023-04-19 13:18:09 2023-04-19 13:22:12 0 [IP Addres… 139.62…     100     242
 9 2023-04-19 14:01:52 2023-04-19 14:05:56 0 [IP Addres… 96.90.…     100     243
10 2023-04-19 15:59:09 2023-04-19 16:01:28 0 [IP Addres… 139.62…     100     138
# … with 11 more rows, 51 more variables: Finished <dbl+lbl>,
#   RecordedDate <dttm>, ResponseId <chr>, RecipientLastName <chr>,
#   RecipientFirstName <chr>, RecipientEmail <chr>, ExternalReference <chr>,
#   LocationLatitude <chr>, LocationLongitude <chr>, DistributionChannel <chr>,
#   UserLanguage <chr>, Consent_Response <dbl+lbl>, Happiness_1 <dbl+lbl>,
#   Happiness_2 <dbl+lbl>, Happiness_3 <dbl+lbl>, Happiness_4 <dbl+lbl>,
#   Happiness_5 <dbl+lbl>, Happiness_6 <dbl+lbl>, Happiness_7 <dbl+lbl>, …

create happiness DV

#create dataframe with only relevant variables to work with
dataset.clean %>% 
  select (starts_with("Happi"))-> happy 

#create list of 'keys'. The  numbers just refer to the order of the question in the data.frame() you just made. The most important thing is to mark the questions that should be reversed scored with a '-'. 
happy.keys <- make.keys(happy, list(happy=c(-1,2,3,4,-5,-6,7,8,9,-10,11,12,-13,-14,15,16,17,18,-19,20,21,22,-23,24,25,26,-27,-28,-29)))

#score the scale
happy.scales <- scoreItems (happy.keys, happy)
In smc, smcs < 0 were set to .0
#save the scores
happy.scores <- happy.scales$scores

#save the scores back in 'dataset'
dataset.clean$happy <- happy.scores[,]

#print the cronbach alpha
happy.scales$alpha
          happy
alpha 0.8905817

Study design table numbers

dataset.clean %>% 
  group_by(animalIV, valenceIV) %>% 
  summarise(mean = mean(happy, na.rm = TRUE), sd = sd(happy, na.rm = TRUE))
`summarise()` has grouped output by 'animalIV'. You can override using the
`.groups` argument.
# A tibble: 4 × 4
# Groups:   animalIV [2]
  animalIV valenceIV  mean    sd
  <chr>    <chr>     <dbl> <dbl>
1 cat      negative   3.70 0.373
2 cat      positive   4.40 0.620
3 dog      negative   3.48 0.790
4 dog      positive   4.01 0.543
dataset.clean %>% 
  group_by(animalIV) %>% 
  summarise(mean = mean(happy, na.rm = TRUE), sd = sd(happy, na.rm = TRUE))
# A tibble: 2 × 3
  animalIV  mean    sd
  <chr>    <dbl> <dbl>
1 cat       4.01 0.589
2 dog       3.74 0.703
dataset.clean %>% 
  group_by(valenceIV) %>% 
  summarise(mean = mean(happy, na.rm = TRUE), sd = sd(happy, na.rm = TRUE))
# A tibble: 2 × 3
  valenceIV  mean    sd
  <chr>     <dbl> <dbl>
1 negative   3.58 0.618
2 positive   4.16 0.577

ANOVA

aov_ez(id = "ResponseId", 
       dv = "happy", 
       data = dataset.clean, 
       between=c("animalIV", "valenceIV"))
Converting to factor: animalIV, valenceIV
Contrasts set to contr.sum for the following variables: animalIV, valenceIV
Anova Table (Type 3 tests)

Response: happy
              Effect    df  MSE      F  ges p.value
1           animalIV 1, 17 0.37   1.31 .072    .268
2          valenceIV 1, 17 0.37 5.14 * .232    .037
3 animalIV:valenceIV 1, 17 0.37   0.09 .005    .764
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1