energy_expt1_full

Data Wrangling

Sixteen outliers were identified and removed based on Cook’s distance (threshold=4/122), resulting in 106 participants in the final sample.

Primary Analysis

Visualization

ggplot(d_final, aes(y = reorder(activity, energy, FUN = median),x=energy,fill=act_type))+ 
  stat_boxplot(geom='errorbar', linetype=1, width=0.5)+
  geom_boxplot() +
  stat_summary(fun.y=mean, geom="point", size=2)+
  scale_fill_manual(values = c("mental" = "#1f77b4", "physical" = "#ff7f0e", "restorative" = "#2ca02c"))+
 # scale_fill_brewer(palette="Set1")+
  theme_minimal()+
  labs(title="Energy Change by Activity",y="Activity",x="Energy Change")
Warning: The `fun.y` argument of `stat_summary()` is deprecated as of ggplot2 3.3.0.
ℹ Please use the `fun` argument instead.

Modeling

library(lme4)
#comparing across types
d_final$act_type <- factor(d_final$act_type, levels = c("physical", "mental", "restorative"))
d_final$act_type <- relevel(d_final$act_type, ref = "mental")
contrasts(d_final$act_type) <- contr.treatment(3) #dummy coding
phys <- d_final |> filter(act_type=="physical")
summary(lmer(formula = energy ~ 1 + (1 |subjectID), data=phys))
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: energy ~ 1 + (1 | subjectID)
   Data: phys

REML criterion at convergence: 5574.6

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-1.7952 -0.6571 -0.1614  0.4490  3.7793 

Random effects:
 Groups    Name        Variance Std.Dev.
 subjectID (Intercept)  75.02    8.662  
 Residual              326.17   18.060  
Number of obs: 636, groups:  subjectID, 106

Fixed effects:
            Estimate Std. Error      df t value Pr(>|t|)    
(Intercept)  -31.028      1.105 105.000  -28.09   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ment <- d_final |> filter(act_type=="mental")
summary(lmer(formula = energy ~ 1 + (1 |subjectID), data=ment))
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: energy ~ 1 + (1 | subjectID)
   Data: ment

REML criterion at convergence: 5202.4

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-2.5776 -0.6404 -0.0364  0.4974  3.1688 

Random effects:
 Groups    Name        Variance Std.Dev.
 subjectID (Intercept)  88.05    9.383  
 Residual              165.27   12.856  
Number of obs: 636, groups:  subjectID, 106

Fixed effects:
            Estimate Std. Error      df t value Pr(>|t|)    
(Intercept)  -11.165      1.044 105.000  -10.69   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
phys_ment <- d_final |> filter(act_type=="physical" |act_type=="mental")
summary(lmer(formula = energy ~ act_type + (1 |subjectID), data=phys_ment))
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: energy ~ act_type + (1 | subjectID)
   Data: phys_ment

REML criterion at convergence: 10860.5

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-2.4652 -0.6906 -0.1302  0.5149  4.4896 

Random effects:
 Groups    Name        Variance Std.Dev.
 subjectID (Intercept)  56.78    7.535  
 Residual              270.28   16.440  
Number of obs: 1272, groups:  subjectID, 106

Fixed effects:
                  Estimate Std. Error        df t value Pr(>|t|)    
(Intercept)       -11.1651     0.9801  171.8668  -11.39   <2e-16 ***
act_typephysical  -19.8632     0.9219 1165.0000  -21.55   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr)
act_typphys -0.470
rest <- d_final |>filter(act_type=="restorative")
summary(lmer(formula = energy ~ 1 + (1 |subjectID), data=rest))
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: energy ~ 1 + (1 | subjectID)
   Data: rest

REML criterion at convergence: 5620.3

Scaled residuals: 
     Min       1Q   Median       3Q      Max 
-2.98352 -0.59627  0.04253  0.67741  2.18508 

Random effects:
 Groups    Name        Variance Std.Dev.
 subjectID (Intercept)  35.87    5.989  
 Residual              375.37   19.374  
Number of obs: 636, groups:  subjectID, 106

Fixed effects:
            Estimate Std. Error       df t value Pr(>|t|)    
(Intercept)  11.7736     0.9636 105.0000   12.22   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

All primary hypotheses were confirmed.

  1. Both physical and mental activities are thought to decrease energy, such that both intercepts are negative and differ significantly from 0 (physical b=-31.03, p<.01; mental b=-11.17, p<.01).

  2. Physical activities are more depleting than mental activities (b=-19.86, p<.01).

  3. Restorative activities are thought to increase energy (b= 11.77, p<.01)

Secondary Analysis

Visualization

library(plotly)

#Violin plot by activity type and rating
df_long <-
  pivot_longer(
    data = d_final,
    cols      = energy:difficulty,
    names_to  = "rating",
    values_to = "value")

ggplot(df_long, aes(x = act_type, y = value, fill = act_type)) +
  geom_violin(outlier.shape = NA, alpha = 0.7) +
  geom_jitter(width = 0.15, size = 0.8, alpha = 0.6) +
  facet_wrap(~ rating, scales = "free_y") +
  labs(x = "Activity type", y = "Rating", title = "Ratings by Activity Type and Rating") +
  theme_minimal() +
  theme(legend.position = "none")
Warning in geom_violin(outlier.shape = NA, alpha = 0.7): Ignoring unknown
parameters: `outlier.shape`

People think mental and physical activities are similarly difficult, and restorative activities are easy. They also think physical and restorative activities are generally fun, while mental activities are generally boring. There is a lot of variability.

People have relatively more systematic energy rating, such that mental and physical activities decrease energy with physical activities being more depleting, and restorative activities restore energy.

#Scatter plot w fitted lines
d_final |>
  ggplot(aes(fun,energy)) +
  geom_jitter(size=1,alpha=0.7)+
  facet_wrap(~act_type) +
  geom_smooth(method = lm)
`geom_smooth()` using formula = 'y ~ x'

d_final |>
  ggplot(aes(difficulty,energy)) +
  geom_jitter(size=1,alpha=0.7)+
  facet_wrap(~act_type) +
  geom_smooth(method = lm)
`geom_smooth()` using formula = 'y ~ x'

d_final |>
  ggplot(aes(difficulty,fun)) +
  geom_jitter(size=1,alpha=0.7)+
  facet_wrap(~act_type) +
  geom_smooth(method = lm)
`geom_smooth()` using formula = 'y ~ x'

Fun and Energy are positively correlated for mental activities, slightly positively correlated for physical activities, and negatively correlated for restorative activities. The less energy-depleting the more fun, and the less energy-restoring the more fun.

Difficulty and Energy are most negatively correlated for physical activities, than mental activities, than restorative activities. The more energy-depleting/less energy-restoring an activity is, the more difficult.

Fun and Difficulty are negatively correlated for physical and restorative activities - the more difficult the less fun. They are slightly negatively correlated for mental activities - the more difficult the more boring.

# Correlation heatmaps by activity
library(ggcorrplot)
corr_phys <- d_final %>%
    filter(act_type == "physical") %>%
    select(energy, difficulty, fun) %>%
    cor(use = "pairwise.complete.obs")

corr_ment <- d_final %>%
    filter(act_type == "mental") %>%
    select(energy, difficulty, fun) %>%
    cor(use = "pairwise.complete.obs")

corr_rest <- d_final %>%
    filter(act_type == "restorative") %>%
    select(energy, difficulty, fun) %>%
    cor(use = "pairwise.complete.obs")

fig_phys <- ggcorrplot(corr_phys, lab = TRUE, lab_col = "black", title = "Physical Activities")
fig_ment <- ggcorrplot(corr_ment, lab = TRUE, lab_col = "black", title = "Mental Activities")
fig_rest <- ggcorrplot(corr_rest, lab = TRUE, lab_col = "black", title = "Restorative Activities")

fig_phys

fig_ment

fig_rest

Another way of visualizing findings from above.

Modeling

# is difficulty and fun rating related to energy rating?
summary(lmer(energy ~ difficulty+fun + (1|subjectID), data=d_final))
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: energy ~ difficulty + fun + (1 | subjectID)
   Data: d_final

REML criterion at convergence: 17008.5

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-2.8838 -0.6534 -0.0788  0.6736  3.5162 

Random effects:
 Groups    Name        Variance Std.Dev.
 subjectID (Intercept)  38.76    6.226  
 Residual              410.18   20.253  
Number of obs: 1908, groups:  subjectID, 106

Fixed effects:
              Estimate Std. Error         df t value Pr(>|t|)    
(Intercept)   18.42745    1.54607  971.65740  11.919  < 2e-16 ***
difficulty    -0.49062    0.01579 1893.35151 -31.076  < 2e-16 ***
fun           -0.09894    0.01578 1895.61810  -6.272 4.42e-10 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
           (Intr) dffclt
difficulty -0.704       
fun        -0.749  0.398
# does the effect of act_type still hold, after adding fun and difficulty?
model1 <- lmer(energy ~ act_type + (1|subjectID), data=d_final)
model2 <- lmer(energy ~ act_type + difficulty+fun + (1|subjectID), data=d_final)

summary(model1)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: energy ~ act_type + (1 | subjectID)
   Data: d_final

REML criterion at convergence: 16525.2

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-3.1697 -0.6887 -0.0788  0.5835  4.2380 

Random effects:
 Groups    Name        Variance Std.Dev.
 subjectID (Intercept)  35.86    5.988  
 Residual              319.15   17.865  
Number of obs: 1908, groups:  subjectID, 106

Fixed effects:
             Estimate Std. Error        df t value Pr(>|t|)    
(Intercept)  -11.1651     0.9166  282.7157  -12.18   <2e-16 ***
act_type2    -19.8632     1.0018 1800.0000  -19.83   <2e-16 ***
act_type3     22.9387     1.0018 1800.0000   22.90   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
          (Intr) act_t2
act_type2 -0.546       
act_type3 -0.546  0.500
summary(model2)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: energy ~ act_type + difficulty + fun + (1 | subjectID)
   Data: d_final

REML criterion at convergence: 16397.2

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-3.1595 -0.6317 -0.0909  0.5734  4.4040 

Random effects:
 Groups    Name        Variance Std.Dev.
 subjectID (Intercept)  35.64    5.97   
 Residual              295.93   17.20   
Number of obs: 1908, groups:  subjectID, 106

Fixed effects:
              Estimate Std. Error         df t value Pr(>|t|)    
(Intercept)    2.24762    1.56778 1168.51001   1.434   0.1519    
act_type2    -17.68266    1.04770 1821.70909 -16.878   <2e-16 ***
act_type3     15.32031    1.21342 1840.38235  12.626   <2e-16 ***
difficulty    -0.20930    0.01749 1902.25632 -11.966   <2e-16 ***
fun           -0.03147    0.01455 1893.62454  -2.163   0.0307 *  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
           (Intr) act_t2 act_t3 dffclt
act_type2  -0.016                     
act_type3  -0.481  0.387              
difficulty -0.760 -0.221  0.468       
fun        -0.536 -0.375 -0.216  0.320

All secondary hypotheses were confirmed:

Both difficulty and fun ratings were related to energy ratings. Difficulty had a significant negative effect, b=−0.49, p<.01. Fun also had a significant negative effect, b=-0.10, p<.01.

The effect of activity type still hold after adding difficulty and fun rating into the model. Physical activities have significantly lower energy rating than mental activities (b=-17, p<.01), while restorative activities have significantly higher energy rating than mental activities (b=15.32, p<.01). At the same time, difficulty and run ratings still explain unique variance in the energy rating, though the effect is less negative compared to when activity type is not accounted for in the model (difficulty b=-0.2, p<.01; fun b=-0.03, P=.03).

This means people’s responses about how energizing or depleting the activities are are indeed correlated with, but cannot be fully explained by, how fun or difficult people perceive the activities to be.