#cleaning up to test trials + energy leveld_task1_clean <- d_task1_filtered %>%filter(!task %in%c("energy-compcheck","diff-compcheck") &!activity %in%c("att_right","att_middle")) %>%mutate(energy_level =case_when(str_detect(stimulus, "extremely tired") ~"extremely tired",str_detect(stimulus, "extremely energetic") ~"extremely energetic",TRUE~NA ))#create pseudo idd_task1_clean <- d_task1_clean %>%group_by(filename) %>%mutate(subjectID =sprintf("sub%03d", cur_group_id())) %>%ungroup() #add pseudo idd_task1_clean$subjectID <-as.factor(d_task1_clean$subjectID)
#adding act_type and act_diff (continuous & categorical)d_task1_labeled <- d_task1_clean %>%mutate(act_type =case_when(str_detect(activity, "run") |str_detect(activity, "clean") |str_detect(activity, "hike") |str_detect(activity, "jump") |str_detect(activity, "climb") |str_detect(activity, "swim") ~"physical",str_detect(activity, "handwriting") |str_detect(activity, "math") |str_detect(activity, "violin") |str_detect(activity, "homework") |str_detect(activity, "flashcards") |str_detect(activity, "alphabet") ~"mental",TRUE~"restorative"))d_task1_labeled <- d_task1_labeled %>%mutate(activity =case_when( activity %in%c("do their homework") ~"do homework", activity %in%c("listen to their favorite stories") ~"listen to favorite stories", activity %in%c("watch their favorite show on the couch") ~"watch favorite show on the couch",TRUE~ activity))d_task1_merged <- d_task1_labeled |> dplyr::left_join(mean_dif, by ="activity")d_task1_merged$act_mean_diff <- d_task1_merged$act_diffd_task1_merged <- d_task1_merged %>%mutate(act_diff_level =case_when(str_detect(stimulus, "run") |str_detect(stimulus, "climb") |str_detect(stimulus, "math") |str_detect(stimulus, "homework") ~"hard",str_detect(stimulus, "hike") |str_detect(stimulus, "house") |str_detect(stimulus, "violin") |str_detect(stimulus, "handwriting") ~"medium",str_detect(stimulus, "jump") |str_detect(stimulus, "swim") |str_detect(stimulus, "alphabet") |str_detect(stimulus, "sounding") ~"easy",TRUE~NA ))
#Removing outlierslibrary(olsrr) library(influence.ME)d_task1_phys_ment <- d_task1_merged |>filter(act_type=="physical"|act_type=="mental")infl <-influence(lmer(formula = response ~ energy_level + (1|subjectID), data=d_task1_phys_ment), group ="subjectID")cooksd <-cooks.distance(infl, sort=TRUE) # this measures how much the model’s fixed-effect estimates change when one subject is droppedplot(infl, which ="cook",cutoff=4/81, sort=TRUE,) # 17 outliers at threshold 4/N
d_task1_after_exclusion <- d_task1_merged %>%filter(!subjectID %in%rownames(cooksd)[cooksd >4/81])length(unique(d_task1_after_exclusion$filename)) # n=64 in final sample
we see an effect of energy level - adults infer things are easier when someone’s energetic than when someone’s tired
also differ by activity type -
physical activities are judged as extremely easy when someone’s energetic, and extremely hard when someone’s tired
mental activities are judged as easy overall (but less easy than physical activities) when someone’s energetic, with a lot of variability. mental activities are judged as hard overall (but less hard than physical activities) when someone’s tired. There seems to be a sense that energy impacts difficulty/cost of physical activities much more than mental activities.
even though energy has large impact on difficulty judgement, people still differentiate between activities of different difficulty levels -
when someone’s energetic, hard physical activities are still judged as less easy than easy/medium physical activities. when someone’s tired, hard mental activities are still judged as more difficult than easy/medium mental activities. This means people make fine-grained difficulty judgments at two energy extremes - being extremely energetic does not make everything equally easy, and being extremely tired does not disable people from carrying out activities and make them find everything equally hard.
One Sample t-test
data: restorative_tired$response
t = -2.3695, df = 195, p-value = 0.01879
alternative hypothesis: true mean is not equal to 50
95 percent confidence interval:
38.95924 48.98974
sample estimates:
mean of x
43.97449
One Sample t-test
data: restorative_energetic$response
t = -4.5576, df = 187, p-value = 9.325e-06
alternative hypothesis: true mean is not equal to 50
95 percent confidence interval:
33.52994 43.48070
sample estimates:
mean of x
38.50532
Are restorative activities always rated easy?
yes, difficulty of restorative activities are rated below 50 (as easy), for both extremely tired and extremely energetic conditions.
d_task1_after_exclusion_physment <- d_task1_after_exclusion |>filter(act_type!="restorative")# Primary H - does difficulty judgement change depending on one's energy level?model1 <-lmer(data=d_task1_after_exclusion_physment, formula=response ~ energy_level + (1|subjectID))summary(model1) #Yes
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: response ~ energy_level + (1 | subjectID)
Data: d_task1_after_exclusion_physment
REML criterion at convergence: 6873.9
Scaled residuals:
Min 1Q Median 3Q Max
-4.4378 -0.6588 0.0028 0.4295 3.7684
Random effects:
Groups Name Variance Std.Dev.
subjectID (Intercept) 57.22 7.564
Residual 420.19 20.499
Number of obs: 768, groups: subjectID, 64
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 30.676 1.444 126.157 21.24 <2e-16 ***
energy_levelextremely tired 61.288 1.518 739.530 40.37 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Correlation of Fixed Effects:
(Intr)
enrgy_lvlxt -0.556
Difficulty judgement of physical and mental activities changes depending on one’s energy level.
# Exploratory Q1 - does difficulty judgment change depending on activity type and/or activity difficulty, on top of energy level? model2 <-lmer(data=d_task1_after_exclusion, formula=response ~ energy_level + act_type + act_mean_diff + (1|subjectID))plot(allEffects(model2))
summary(model2) # Yes
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: response ~ energy_level + act_type + act_mean_diff + (1 | subjectID)
Data: d_task1_after_exclusion
REML criterion at convergence: 11059
Scaled residuals:
Min 1Q Median 3Q Max
-2.9717 -0.6598 0.0809 0.6119 2.9304
Random effects:
Groups Name Variance Std.Dev.
subjectID (Intercept) 37.99 6.163
Residual 845.77 29.082
Number of obs: 1152, groups: subjectID, 64
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 18.9899 4.8768 1146.9370 3.894 0.000104 ***
energy_levelextremely tired 42.5524 1.7419 1137.2746 24.429 < 2e-16 ***
act_typemental 4.9192 2.1502 1083.7827 2.288 0.022343 *
act_typerestorative -4.7315 3.9377 1083.8065 -1.202 0.229788
act_mean_diff 0.3077 0.0691 1083.9389 4.454 9.32e-06 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Correlation of Fixed Effects:
(Intr) enrg_t act_typm act_typr
enrgy_lvlxt -0.149
act_typmntl -0.414 0.019
act_typrstr -0.895 -0.026 0.443
act_men_dff -0.919 -0.050 0.215 0.846
Difficulty judgment changes depending on activity type and activity difficulty, after taking energy level into account. In extremely energetic condition, mental activities are rated 4.9 points higher than physical activities, while restorative activities are rated no different from physical activities. For every 1-unit increase in activity mean difficulty, there is 0.3 unit increase in inferred difficulty.
# Exploratory Q2 - does the effect of energy level on difficulty judgment change depending on activity type, taking into account mean activity difficulty? model3 <-lmer(data=d_task1_after_exclusion, formula=response ~ energy_level*act_type + act_mean_diff + (1|subjectID))plot(allEffects(model3))
When extremely energetic, mental activities are rated 19.2 points harder than physical activities, and restorative activities are rated 29 points harder than physical activities (both p<.001). When extremely tired, mental activities are rated 7.3 points (19.2-26.5) less difficult than physical activities, and restorative activities are rated 40.1 (29-69.1) easier than physical activities (both p<.001).
People rated physical activities 74.6 points harder in tired than energetic condition, mental activities 48 points harder in tired than in energetic condition, and restorative activities 5.5 points harder in tired than in energetic condition.
increase in activity difficulty leads to 0.25 points higher inferred difficulty judgement.
# Exploratory Q3 - does the effect of energy level on difficulty judgment change depending on activity type, or difficulty level, or both? model4 <-lmer(data=d_task1_after_exclusion, formula=response ~ energy_level*act_type*act_diff_level + (1|subjectID))plot(allEffects(model4))
In extremely tired condition, mental activities are rated as 32.8 points less difficult than physical activities, hard activities are rated as 10.8 points less difficult than easy activities??