Loading required package: lmerTest
Loading required package: lme4
Loading required package: Matrix
Attaching package: 'Matrix'
The following objects are masked from 'package:tidyr':
expand, pack, unpack
Attaching package: 'lmerTest'
The following object is masked from 'package:lme4':
lmer
The following object is masked from 'package:stats':
step
Rows: 12 Columns: 23
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (23): StartDate, EndDate, Status, Progress, Duration (in seconds), Finis...
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
### DATA WRANGLING & CLEANING ##### Participant Infos1.df$gender <-factor(s1.df$gender,labels=c("Male","Female","Other"))names(s1.df)[1] <-"Subject"s1.df$age <-as.numeric(s1.df$age)s1.df$Eval <-as.numeric(s1.df$Eval)### END DATA WRANGLING & CLEANING ##### Demographic informationtable(s1.df$gender)
# A tibble: 2 × 3
Condition EVAL EVAL_SD
<chr> <dbl> <dbl>
1 BornAfter 1.75 0.957
2 BornBefore NA NA
## T-test and Cohen's d## Condition refers to born after/before invention (experimentally manipulated)t.test(Eval ~ Condition, var.equal=TRUE, data=s1.df)
Two Sample t-test
data: Eval by Condition
t = 1.8884, df = 7, p-value = 0.1009
alternative hypothesis: true difference in means between group BornAfter and group BornBefore is not equal to 0
95 percent confidence interval:
-0.3404524 3.0404524
sample estimates:
mean in group BornAfter mean in group BornBefore
1.75 0.40
effsize::cohen.d(Eval ~ Condition, data = s1.df)
Cohen's d
d estimate: 1.266774 (large)
95 percent confidence interval:
lower upper
-0.469496 3.003044
### END Analysis WITHOUT exclusions### Analysis WITH exclusions ##### Exclusiontable(s1.df$attn_check_1) #
3
9
table(s1.df$attn_check_2)
2
9
table(s1.df$prior_knowledge) #
0 1
5 4
# Exclude participants who failed manipulation check or knew what aerogel wass1.df.f <- s1.df %>%filter(attn_check_1 =="3"& attn_check_2 =="2") %>%filter(prior_knowledge !="1")## Descriptive statisticss1.cond.difs <- s1.df.f %>%group_by(Condition) %>%summarise(EVAL =mean(Eval), EVAL_SD =sd(Eval))s1.cond.difs
## T-test and Cohen's d t.test(Eval ~ Condition, var.equal=TRUE, data=s1.df.f)
Two Sample t-test
data: Eval by Condition
t = 1.8974, df = 3, p-value = 0.154
alternative hypothesis: true difference in means between group BornAfter and group BornBefore is not equal to 0
95 percent confidence interval:
-1.354593 5.354593
sample estimates:
mean in group BornAfter mean in group BornBefore
2 0
effsize::cohen.d(Eval ~ Condition, data = s1.df.f)
Cohen's d
d estimate: 1.732051 (large)
95 percent confidence interval:
lower upper
-1.655922 5.120024
## Age and Evaluation correlationcor.test(s1.df.f$age, s1.df.f$Eval)
Pearson's product-moment correlation
data: s1.df.f$age and s1.df.f$Eval
t = 0.54772, df = 3, p-value = 0.622
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.7912338 0.9350437
sample estimates:
cor
0.3015113
## Make Condition.Num numeric so it can be scaled in lms1.df.f$Condition.Num <-rep(NA, length(s1.df.f$Condition))s1.df.f$Condition.Num[s1.df.f$Condition=="BornAfter"] <-0s1.df.f$Condition.Num[s1.df.f$Condition=="BornBefore"] <-1## Age and Condition multilevel models1.lm.age <-lm(scale(Eval) ~scale(age) +scale(Condition.Num), data = s1.df.f)summary(s1.lm.age)
Call:
lm(formula = scale(Eval) ~ scale(age) + scale(Condition.Num),
data = s1.df.f)
Residuals:
1 2 3 4 5
-6.742e-01 2.188e-17 6.742e-01 6.742e-01 -6.742e-01
attr(,"scaled:center")
[1] 1.2
attr(,"scaled:scale")
[1] 1.483
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.438e-17 4.264e-01 0.000 1.000
scale(age) 4.933e-18 5.222e-01 0.000 1.000
scale(Condition.Num) -7.385e-01 5.222e-01 -1.414 0.293
Residual standard error: 0.9535 on 2 degrees of freedom
Multiple R-squared: 0.5455, Adjusted R-squared: 0.09091
F-statistic: 1.2 on 2 and 2 DF, p-value: 0.4545