generated from byu-transpolab/template_quarto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
04_results.qmd
491 lines (384 loc) · 33.2 KB
/
04_results.qmd
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
# Results and Discussions
```{r setup2, file = "R/chapter_start.R", include = FALSE, cache = FALSE}
library(plm)
library(sandwich)
```
```{r model-setups, include=FALSE}
f <- function(x) format(round(x, 3), big.mark=",")
gm <- list(
list("raw" = "nobs", "clean" = "No. of Obs.", "fmt" = f),
list("raw" = "logLik", "clean" = "Log. Liklihood", "fmt" = f),
list("raw" = "aic", "clean" = "AIC", "fmt" = f),
list("raw" = "r.squared", "clean" = "R\u00b2", "fmt" = f))
cm <- c(
"sev_day_avg" = "Sev-Day No. of Acts.",
"sexFemale" = "Female",
"age" = "Age",
"fsiq_2" = "IQ Score",
"prescribed_groupAutism" = "Autism",
"prescribed_groupSocial Anxiety" = "Social Anxiety",
"suicidal_ideation_q31_evenTRUE" = "Suicidal Ideation",
"energy" = "Energy",
"motivation" = "Motivation",
"area" = "Activity Area",
"length" = "Distance",
"numTrips" = "No. of Activities")
cm_comp <- c(
"numTrips" = "No. of Activities",
"log(numTrips + 0.1)" = "log (No. of Activities)",
"I(numTrips^2)" = "No. of Activities\u00b2",
"sev_day_avg" = "Sev-Day No. of Acts.",
"area" = "Activity Area",
"length" = "Distance",
"log(length)" = "log (Distance)",
"I(length^2)" = "Distance\u00b2",
"suic_intensity" = "Suicidal Intesity",
"park" = "Park",
"library" = "Library",
"grocery" = "Grocery Store",
"social_rec" = "Social Recreation",
"sev_day_avg_park" = "Seven-Day Park",
"sev_day_avg_grocery" = "Seven-Day Grocery",
"sev_day_avg_library" = "Seven-Day Library")
cm_group <- c(
"numTrips" = "No. of Activities",
"sev_day_avg" = "Sev-Day No. of Acts.",
"park" = "Visits to Parks",
"grocery" = "Visits to Grocery Store",
"library" = "Visits to Libraries",
"social_rec" = "Visits to Social Recreation Locations")
```
Analyzing travel behavior and mental well-being requires a comprehensive examination of the individual's group. It is important to look at various factors related to how these groups travel and how their travel affects their well-being. Understanding the number and type of activities they engage in, motivational levels, and propensity towards suicidal ideation provides valuable insights for this analysis.
## Activity Engagement by Group
This analysis examined the activity engagement patterns of the three groups: control, autism, and social anxiety. We analyzed the total number of activities and the seven-day rolling average number of activities for individuals in these groups. The descriptive statistics in @tbl-groupActs describe these results for each group.
```{r table groupAct, echo=FALSE, message = FALSE, warning=FALSE}
#| label: tbl-groupActs
#| tbl-cap: "Activity Descriptive Statistics by Group"
tar_load(model_data)
acts <- model_data %>%
filter(!is.na(numTrips)) %>%
select(prescribed_group, numTrips, sev_day_avg) %>%
# , park, grocery, library, social_rec) %>%
group_by(prescribed_group) %>%
rename("No. of Activities" = numTrips,
"Sev-Day No. of Acts." = sev_day_avg)
# "Visits to Parks" = park,
# "Visits to Grocery Store" = grocery,
# "Visits to Libraries" = library,
# "Visits to Social Recreation Locations" = social_rec)
datasummary_balance(~prescribed_group, data = acts, dinm=FALSE, align = "lcccccc", output = "kableExtra") |>
kable_styling(latex_options="scale_down")
```
Individuals in the control group engaged in an average of 3.0 activities, while the autism group averaged 2.1, and the social anxiety group averaged 2.6 activities. Standard deviations for the groups ranged from 2.3 to 2.7. A seven-day rolling average of activities showed similar trends but with slightly lower variability.
An ANOVA test revealed significant differences in the mean number of activities between the groups, with an F value of 32.97 and a p-value less than 0.001, indicating that the variation across groups was statistically significant. @fig-ANOVAActs displays the mean activities and 95% confidence intervals for group differences.
```{r figure ANOVAActs, message=FALSE, echo=FALSE, warning=FALSE}
#| label: fig-ANOVAActs
#| fig-cap: "Mean number of activities by group."
actsANOVA <- model_data %>%
filter(!is.na(numTrips)) %>%
mutate(prescribed_group = as.factor(prescribed_group)) %>%
rename(Group = prescribed_group)
ggplot(actsANOVA, aes(x = Group, y = numTrips)) +
stat_summary(fun = mean, geom = "point", color = "black") +
stat_summary(fun.data = mean_cl_normal, geom = "errorbar", width = 0.2) +
labs(x = "Group", y = "Number of Activities") +
theme_bw()
```
After finding significant differences in activity levels among the three groups, a Tukey's Honest Significant Difference (HSD) test identified specific group differences. Individuals in the autism group participated in significantly fewer activities than the control group, with a mean difference of -0.896 (p \< 0.001), and compared to the social anxiety group, with a mean difference of -0.375 (p \< 0.001). Similarly, the social anxiety group engaged in fewer activities than the control group, with a mean difference of -0.521 (p \< 0.001).
These results show significant differences in activity engagement across groups, with individuals with autism and social anxiety participating less than those in the control group. This underscores the importance of considering group differences when analyzing activity patterns and mental health outcomes.
## Motivation by Group
We observed notable differences in well-being among the groups. Based on existing literature, we expected that individuals in the autism and social anxiety groups would report lower well-being compared to the control group. Using motivation as an indicator of well-being, we analyzed motivation levels from the evening survey, rated on a 1-100 scale. @tbl-groupMotiv presents the mean and standard deviation of motivation for each group.
```{r table groupMotiv, message=FALSE, echo=FALSE, warning=FALSE}
#| label: tbl-groupMotiv
#| tbl-cap: "Motivation Levels by Group"
tar_load(model_data)
motiv <- model_data %>%
filter(!is.na(numTrips)) %>%
select(prescribed_group, motivation) %>%
group_by(prescribed_group) %>%
mutate("Motivation" = motivation)
motiv_tbl <- motiv %>%
select(prescribed_group, "Motivation")
datasummary_balance(~prescribed_group, data = motiv_tbl, dinm=FALSE, align = "lcccccc", output = "kableExtra")
```
The findings revealed differences in motivation across the groups. The control group had the highest mean motivation score of 47.7, with the lowest variability (standard deviation of 14.2), falling slightly below the middle range of the "typical motivation" category. The autism group had the lowest mean score of 34.0, with the highest variability (standard deviation of 19.4), falling in the "enough motivation to get by" category. The social anxiety group had a mean score of 40.3, falling between the other two groups and on the lowest end of the "typical motivation" category. An ANOVA test confirmed significant differences in motivation levels among the groups, with an F value of 362 and a p-value less than 0.001, indicating that these differences are statistically significant.
After confirming significant differences in motivation levels among the three groups, a Tukey's HSD test was conducted to identify specific group differences. The autism group had a significantly lower mean motivation level than the control group, with a difference of -9.99 points. The social anxiety group also had a significantly lower motivation level compared to the control group, with a difference of -7.74 points. When comparing the autism and social anxiety groups, the social anxiety group had a significantly higher motivation level by 2.25 points. All differences had p-values less than 0.001.
These results highlight significant differences in motivation levels, with the control group showing higher motivation than both the autism and social anxiety groups, and the social anxiety group showing higher motivation than the autism group. This pattern underscores the impact that the group has on an individual's motivation.
## Suicidal Ideation by Group
The morning and evening surveys included different questions pertaining to suicidal ideation. The dataset presents an insightful glimpse into the prevalence of suicidal ideation within the groups, shedding light on potential differences in mental health concerns among them. We examined responses to the question "Have you thought about killing yourself in the past 12 hours or since you last took a survey?" across the three groups, where responses were "Yes," "No," or "No Response." The responses to this question are summarized by group in @tbl-groupSuicide.
```{r table groupSuicide, message=FALSE, echo=FALSE, warning=FALSE}
#| label: tbl-groupSuicide
#| tbl-cap: "Suicidal Ideation by Group"
tar_load(model_data)
suic <- model_data %>%
filter(!is.na(numTrips)) %>%
select(prescribed_group, suicidal_ideation_q31_even) %>%
mutate(suicidal_ideation_q31_even = case_when(
suicidal_ideation_q31_even == TRUE ~ "Yes",
suicidal_ideation_q31_even == FALSE ~ "No",
is.na(suicidal_ideation_q31_even) ~ "No Response",
TRUE ~ as.character(suicidal_ideation_q31_even)
)) %>%
mutate(suicidal_ideation_q31_even = factor(suicidal_ideation_q31_even, levels = c("Yes", "No", "No Response"))) %>%
group_by(prescribed_group) %>%
rename("Suicidal Ideation" = suicidal_ideation_q31_even)
datasummary_balance(~prescribed_group, data = suic, coef_map = cm_group, dinm=FALSE, align = "llcccccc", output = "kableExtra")
```
In the control group, participants reported no suicidal ideation on 66.4% of days and acknowledged suicidal thoughts on 2.1% of days. In the autism group, 51.6% of days were reported as ideation-free, while 4.9% of days involved suicidal ideation. The social anxiety group showed a different pattern, with no ideation reported on only 38.9% of days and ideation present on 15.6% of days. Some respondents across all groups chose not to answer, indicating the sensitive nature of the question.
A contingency table was constructed to organize the responses ("Yes," "No," or "No Response") by group, and a chi-square test of independence was performed. The test yielded a chi-square statistic of 388.06 with 4 degrees of freedom, and a p-value less than 0.001, indicating a significant association between group and suicidal ideation responses. This suggests that grouptypology influences the likelihood of reporting suicidal ideation, highlighting differences in how individuals from each group experience suicidal thoughts.
## Model Comparison and Evaluation
As discussed previously, we ran three different models to analyze the effect of the seven-day rolling average number of activities on motivation levels. We ran the OLS, FE, and RE models with robust standard errors and t-statistics due to the potential for autocorrelation and heteroskedasticity. The results of these three models are shown in @tbl-olsfere.
```{r table ols fe re, message=FALSE, echo=FALSE, warning=FALSE}
#| label: tbl-olsfere
#| tbl-cap: "OLS, FE, and RE Models"
#| warnings: FALSE
library(plm)
tar_load(ols)
tar_load(fe)
tar_load(re)
models_olsfere <- list(
"OLS" = ols,
"FE" = fe,
"RE" = re
)
modelsummary(models_olsfere, gof_map = gm, coef_map = cm,
vcov = function(x) vcovHC(x, cluster = "time"),
estimate = c("{estimate}{stars}"),
statistic = c("({statistic})"),
notes = list("Robust t-statistics in parentheses. + p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001"),
output = "kableExtra"
)
```
We used the Hausman test to compare the RE and FE models. The test checks whether the RE model estimates are consistent and efficient compared to the FE estimates. The null hypothesis assumes RE estimates are consistent and efficient, while the alternative supports the FE model. With a p-value of 0.0013 (less than 0.05), we reject the null hypothesis, indicating that the RE model is inconsistent. Therefore, the FE model is more appropriate and was used for the remainder of the analysis.
## Effect of Demographic Factors on Motivation
Given the Hausman test results, we used the FE model for analyzing activity patterns and mental health data. A limitation of the FE model is its inability to account for time-constant variables. To address this, we performed a linear regression to assess how demographic factors (e.g., sex, age, IQ score, and group) are associated with the intercepts from the FE model. This linear regression is described generally in @eq-linreg
$$
\bar{y}_{i} \; \tilde{} \; \beta (\vec{X}_{it})
$$ {#eq-linreg}
This allows us to understand how the baseline levels of motivation differ across groups. The sex, age, IQ score, and group were the independent variables, and the FE intercept values for each userID served as the dependent variable. The results from this model are shown in @tbl-fedemolm.
```{r table fe demo lm, message=FALSE, echo=FALSE, warning=FALSE}
#| label: tbl-fedemolm
#| tbl-cap: "Fixed Effects and Demographics Regression"
tar_load(fe_model)
modelsummary(fe_model, gof_map = gm, coef_map = cm,
estimate = c("{estimate} ({statistic}){stars}"),
statistic = NULL,
notes = list("t-statistics in parentheses. + p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001"),
output = "kableExtra"
)
```
The analysis revealed significant findings regarding motivation levels. Being female was associated with a decrease of 6.351 points in motivation compared to males, with a statistically significant p-value less than 0.05. Age and IQ score did not show significant associations. In contrast, individuals with autism had a substantial decrease in motivation of 10.247 points compared to the control group, while those with social anxiety experienced an 8.544 point decrease, both with p-values less than 0.01. These results indicate that sex and group status significantly influence motivation levels, while age and IQ score have limited impact. The model explained approximately 26.4% of the variance in motivation, suggesting that other factors may also contribute. Overall, these findings highlight the importance of considering individual differences, particularly sex and group status, in examining motivation, with a focus on group typology for further exploration.
## Models by Group
After identifying statistical differences in mean motivation, number of activities, and suicidal tendencies across the three groups, we opted to model each group separately. This approach aims to capture the unique characteristics and behaviors within each group, potentially revealing more nuanced relationships between variables and outcomes. Given the need for a FE model to account for individual differences, this method ensures that both observed and unobserved participant characteristics are considered in the analysis. Moving forward, we will employ FE models for each group, allowing us to explore factors influencing motivation while accounting for the distinct attributes of each subgroup.
### Motivation and Number of Activities
To visualize the need to look at each group separately and each individually separately, we plotted the number of activities and levels of motivation for all individuals within each group. @fig-Analy shows the relationship between motivation and the number of activities by group before taking into account the FE.
```{r figure groupAnaly, message=FALSE, echo=FALSE, warning=FALSE}
#| label: fig-Analy
#| fig-cap: "Motivation vs. number of activities for all three groups."
numActs <- model_data %>%
filter(!is.na(numTrips) & !is.na(motivation))
ggplot(numActs, aes(y = motivation, x = numTrips, color = prescribed_group)) +
geom_point(alpha = 0.5) +
geom_smooth(method = "lm", se = FALSE, color = "black") +
facet_wrap(~prescribed_group) +
labs(y = "Level of Motivation", x = "Number of Activities") +
theme_bw() +
# theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
scale_x_continuous(breaks = seq(min(model_data$numTrips, na.rm = TRUE), max(model_data$numTrips, na.rm = TRUE), by = 2)) +
guides(color = FALSE)
```
This analysis revealed that, without accounting for FE, there is no significant relationship between the number of activities and motivation in the control group. However, for the autism group, a steep slope indicates that as the number of activities increases, so does motivation. The social anxiety group also shows a positive slope, though less pronounced, suggesting a correlation between increased activities and higher motivation levels. These findings contradict existing literature, which support that motivation in the autism and social anxiety groups should not necessarily rise with more activities, underscoring the importance of using the FE model.
@fig-FEAnaly presents plots illustrating the influence of activities on motivation. The dashed pooling line represents the intercept and slope if all data were analyzed together, while the solid lines show individual lines of best fit for each participant. This means each individual has a different intercept, but all share the same slope.
```{r figure groupAnaly, message=FALSE, echo=FALSE, warning=FALSE}
#| label: fig-FEAnaly
#| fig-cap: "FE model for motivation vs. number of activities for all participants."
## ALL THREE GROUPS
fixed <- plm(motivation ~ numTrips, index = c("userId", "activityDay"), data = model_data)
# plot(fixed, pooling = TRUE, within = TRUE)
#
# plot(fixed)
z <- fixef(fixed)
fe <- tibble(fe = z, userId = names(z))
data_f <- model_data |>
as_tibble() |>
transmute(
userId, activityDay, motivation, numTrips
) %>%
left_join(fe, by = "userId") %>%
filter(!is.na(fe) & !is.na(numTrips) & !is.na(motivation))
userId_mean <- data_f %>%
group_by(userId) %>%
summarise(
motivation = mean(motivation),
numTrips = mean(numTrips),
fe = mean(fe)
)
segw = 1
ggplot() +
geom_point(data = data_f, aes(x = numTrips, y = motivation), alpha = 0.2, color = "gray30") +
geom_smooth(data = data_f, aes(x = numTrips, y = motivation, linetype = "Pooling"), method = "lm", se = FALSE, color = "black", linewidth = 1) +
geom_point(data = userId_mean, aes(x = numTrips, y = motivation), color = "lightseagreen", shape = 21, size = 1.5, fill = "lightseagreen") +
geom_segment(data = userId_mean, aes(x = numTrips - segw, xend = numTrips + segw,
y = motivation - segw * fixed$coefficients[1],
yend = motivation + segw * fixed$coefficients[1],
linetype = "Within"), color = "lightseagreen", linewidth = 0.6) +
theme_bw() +
xlab("Number of Activities") +
ylab("Level of Motivation") +
scale_linetype_manual(name = "Legend", values = c("Pooling" = "dashed", "Within" = "solid")) +
theme(legend.position = "right") +
scale_x_continuous(breaks = seq(min(data_f$numTrips, na.rm = TRUE), max(data_f$numTrips, na.rm = TRUE), by = 2)) +
scale_y_continuous(breaks = seq(min(data_f$motivation, na.rm = TRUE), max(data_f$motivation, na.rm = TRUE), by = 20))
```
While modeling each participant individually is crucial for accounting for varying baseline levels of motivation, we found that applying a FE model to each group—control, autism, and social anxiety—was also important for understanding the true relationship between the number of activities and motivation, as each group may have different baseline levels.
@fig-groupFE presents the results of the FE models for all three groups. These models predict motivation based on the number of activities while considering both individual and group baseline differences. This approach allows for a more accurate assessment of the impact of activities on motivation within each distinct group. The plots illustrate unique patterns for each group, emphasizing the value of tailored analyses. Notably, the autism and social anxiety groups show steeper slopes when all data are pooled together; however, when individuals are analyzed separately, the slopes for each group are much less steep. These results align more closely with expectations from existing literature.
```{r figure groupFE, message=FALSE, echo=FALSE, warning=FALSE}
#| label: fig-groupFE
#| fig-cap: "FE model for motivation vs. number of activities by group."
z <- fixef(fixed)
fe <- tibble(fe = z, userId = names(z))
data_f <- model_data |>
as_tibble() |>
transmute(
userId, activityDay, prescribed_group, motivation, numTrips
) %>%
left_join(fe, by = "userId") %>%
filter(!is.na(fe) & !is.na(numTrips) & !is.na(motivation))
userId_mean <- data_f %>%
group_by(userId, prescribed_group) %>%
summarise(
motivation = mean(motivation),
numTrips = mean(numTrips),
fe = mean(fe)
)
segw = 2
ggplot() +
geom_point(data = data_f, aes(x = numTrips, y = motivation), alpha = 0.2, color = "gray30") +
geom_smooth(data = data_f, aes(x = numTrips, y = motivation, linetype = "Pooling"), method = "lm", se = FALSE, color = "black", linewidth = 1) +
geom_point(data = userId_mean, aes(x = numTrips, y = motivation, color = prescribed_group, fill = prescribed_group), shape = 21, size = 1.5) +
geom_segment(data = userId_mean, aes(x = numTrips - segw, xend = numTrips + segw,
y = motivation - segw * fixed$coefficients[1],
yend = motivation + segw * fixed$coefficients[1],
color = prescribed_group, linetype = "Within"), linewidth = 0.6) +
facet_wrap(~prescribed_group) +
guides(color = FALSE, fill = FALSE) +
theme_bw() +
xlab("Number of Activities") +
ylab("Level of Motivation") +
scale_linetype_manual(name = "Legend", values = c("Pooling" = "dashed", "Within" = "solid")) +
theme(legend.position = "right") +
scale_x_continuous(breaks = seq(min(data_f$numTrips, na.rm = TRUE), max(data_f$numTrips, na.rm = TRUE), by = 2)) +
scale_y_continuous(breaks = seq(min(data_f$motivation, na.rm = TRUE), max(data_f$motivation, na.rm = TRUE), by = 20))
```
```{r}
# ## CONTROL GROUP
# control <- model_data %>%
# filter(prescribed_group == "Control")
# fixed_control <- plm(motivation ~ numTrips, index = c("userId", "activityDay"), data = control, model = "within")
#
# ## AUTISM GROUP
# autism <- model_data %>%
# filter(prescribed_group == "Autism")
# fixed_autism <- plm(motivation ~ numTrips, index = c("userId", "activityDay"), data = autism, model = "within")
#
# # SOCIAL ANXIETY GROUP
# social_anxiety <- model_data %>%
# filter(prescribed_group == "Social Anxiety")
# fixed_social_anxiety <- plm(motivation ~ numTrips, index = c("userId", "activityDay"), data = social_anxiety, model = "within")
#
# plot(fixed_control)
# plot(fixed_autism)
# plot(fixed_social_anxiety)
```
Since the FE models require both an evening survey response for motivation and the number of activities determined by the DBSCAN-TE algorithm, some data were lost. This reduced the sample size from 31 to 23 in the control group, from 29 to 17 in the autism group, and from 28 to 22 in the social anxiety group. The FE models need enough data points for each participant to ensure effective analysis, which explains the reduction in participants. After visualizing the relationships, we proceeded with running the FE models for each group. The results from these models are presented in @tbl-groupFEAnaly.
```{r table groupAnaly, message=FALSE, echo=FALSE, warning=FALSE}
#| label: tbl-groupFEAnaly
#| tbl-cap: "FE Models: Motivation and Number of Activities by Group"
sep_groups <- model_data %>%
group_by(prescribed_group) %>%
nest() %>%
mutate(
model = map(data, function(d) plm(motivation ~ numTrips, index = c("userId", "activityDay"), data = d, model = "within"))
)
modelsummary(sep_groups$model %>% set_names(str_c("Group: ", sep_groups$prescribed_group)),
gof_map = gm, coef_map = cm_comp,
vcov = function(x) vcovHC(x, cluster = "time"),
estimate = c("{estimate}{stars}"),
statistic = c("({statistic})"),
notes = list("Robust t-statistics in parentheses. + p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001"),
output = "kableExtra")
```
The FE models for the control, autism, and social anxiety groups revealed different relationships between the number of activities and motivation. For the control group, the coefficient was 0.259, suggesting a marginally positive but not strongly significant relationship. In the autism group, the coefficient was 0.361, also indicating a positive but statistically insignificant relationship between activities and motivation. However, the social anxiety group had a coefficient of 0.483, showing a statistically significant positive relationship. This suggests that increasing activities is notably linked to higher motivation for individuals with social anxiety.
These findings underscore the importance of recognizing individual differences across groups. The significant positive relationship in the social anxiety group suggests that increasing activities could be particularly effective in enhancing motivation for this population. In contrast, the control and autism groups did not show strong evidence of this relationship, indicating that other factors might play a more critical role in influencing motivation for these groups.
### Motivation and Suicidal Ideation
The prevalence of suicidal ideation across the groups underscores the complex interplay between mental health and activity engagement. The literature suggests that suicidal behavior is negatively associated with overall well-being [@fonseca-pedreroRiskProtectiveFactors2022; @fumeroAdolescentsBipolarExperiences2021]. Since we connected motivation to well-being, a similar association is drawn between suicidal tendency and motivation.
Based on similar conclusions from the motivation and number of activities analysis, we continued to perform the analysis by group. @tbl-groupFESuic shows the FE models for the impact of suicidal intensity, which was scored from 1-100, on level of motivation, which was also scored from 1-100, for individuals by group.
```{r table groupAnaly, message=FALSE, echo=FALSE, warning=FALSE}
#| label: tbl-groupFESuic
#| tbl-cap: "FE Models: Motivation and Suicidal Intensity by Group"
analysis <- model_data %>%
select(userId, prescribed_group, activityDay, motivation, numTrips, sev_day_avg, suicidal_intensity_q32_even) %>%
filter(!is.na(suicidal_intensity_q32_even) & suicidal_intensity_q32_even != "CONDITION_SKIPPED") %>%
mutate(suic_intensity = as.numeric(suicidal_intensity_q32_even)) %>%
filter(!is.na(suic_intensity)) %>%
group_by(prescribed_group) %>%
nest() %>%
mutate(
model = map(data, function(d) plm(motivation ~ suic_intensity, index = c("userId", "activityDay"), data = d, model = "within"))
)
modelsummary(analysis$model %>% set_names(str_c("Group: ", analysis$prescribed_group)),
gof_map = gm, coef_map = cm_comp,
vcov = function(x) vcovHC(x, cluster = "time"),
estimate = c("{estimate}{stars}"),
statistic = c("({statistic})"),
notes = list("Robust t-statistics in parentheses. + p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001"),
output = "kableExtra")
```
The FE models for the autism, social anxiety, and control groups show distinct relationships between suicidal intensity and motivation levels. In the autism group, the coefficient for suicidal intensity is -0.095, indicating a marginally significant negative relationship, suggesting that higher suicidal intensity may slightly reduce motivation, though the evidence is weak. In contrast, the social anxiety group shows a coefficient of -0.160, with a statistically significant negative relationship, meaning higher suicidal intensity is strongly linked to decreased motivation. Similarly, the control group’s coefficient is -0.361, with a significant negative relationship, showing that increased suicidal intensity is associated with notably lower motivation levels.
These findings emphasize the need to consider the impact of suicidal intensity on motivation within each group. While the relationship is negative across all groups, the varying strength and significance highlight the necessity for tailored interventions to address motivational challenges in each population.
## Activity Types
We examined how the number of activities at different locations—such as parks, grocery stores, libraries, and social recreation spaces—impacts motivation across each group. The analysis factored in activity counts determined by the DBSCAN-TE algorithm, along with seven-day and 14-day moving averages. While all activity locations and measurements were included, only a few yielded statistically significant results. Notably, significant findings emerged for the seven-day average park activities and daily grocery store activities, highlighting their potential influence on individual motivation levels.
### Activities at Parks
@tbl-groupFEParks presents the FE models for the seven-day rolling average number of activities at parks for the three groups.
```{r table groupParks, message=FALSE, echo=FALSE, warning=FALSE}
#| label: tbl-groupFEParks
#| tbl-cap: "FE Models: Motivation and Number of Activities at Parks by Group"
locations <- model_data %>%
select(userId, activityDay, prescribed_group, motivation, numTrips, park, sev_day_avg_park, library, sev_day_avg_library, grocery, sev_day_avg_grocery, social_rec) %>%
group_by(prescribed_group) %>%
nest() %>%
mutate(
model = map(data, function(d) plm(motivation ~ sev_day_avg_park, index = c("userId", "activityDay"), data = d, model = "within"))
)
modelsummary(locations$model %>% set_names(str_c("Group: ", locations$prescribed_group)),
gof_map = gm, coef_map = cm_comp,
vcov = function(x) vcovHC(x, cluster = "time"),
estimate = c("{estimate}{stars}"),
statistic = c("({statistic})"),
notes = list("Robust t-statistics in parentheses. + p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001"),
output = "kableExtra")
```
In examining park activities, statistically significant results were observed solely for the control group. A positive correlation emerged, indicating that each additional park activity within a seven-day period corresponded with a 3.017-point increase in motivation score. This suggests that frequent park visits over a week are linked to heightened motivation levels among individuals in the control group. Conversely, the analysis did not unveil any significant correlation between park visits and motivation levels for the autism and social anxiety groups. This implies that park activities within the examined time frames do not notably affect motivation levels for these groups.
### Activities at Grocery Stores
@tbl-groupFEGrocery presents the FE models for the number of activities at grocery stores for the three groups.
```{r table groupGrocery, message=FALSE, echo=FALSE, warning=FALSE}
#| label: tbl-groupFEGrocery
#| tbl-cap: "FE Models: Motivation and Number of Activities at Grocery Stores by Group"
locations <- model_data %>%
select(userId, activityDay, prescribed_group, motivation, numTrips, park, sev_day_avg_park, library, sev_day_avg_library, grocery, sev_day_avg_grocery, social_rec) %>%
group_by(prescribed_group) %>%
nest() %>%
mutate(
model = map(data, function(d) plm(motivation ~ grocery, index = c("userId", "activityDay"), data = d, model = "within"))
)
modelsummary(locations$model %>% set_names(str_c("Group: ", locations$prescribed_group)),
gof_map = gm, coef_map = cm_comp,
vcov = function(x) vcovHC(x, cluster = "time"),
estimate = c("{estimate}{stars}"),
statistic = c("({statistic})"),
notes = list("Robust t-statistics in parentheses. + p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001"),
output = "kableExtra")
```
The examination of grocery store visits unveiled intriguing trends across the different groups. Notably, a statistically significant negative correlation was found for the autism group, indicating a decrease in motivation by 2.725 points with each additional grocery store activity (p \< 0.001). Similarly, the control group exhibited a slight negative correlation (p \< 0.1), with each additional daily extra grocery store visit reducing motivation by 2.690 points. Conversely, no statistical significance was observed for the social anxiety group. These findings underscore a nuanced connection between grocery store visits and motivation, with notable negative impacts identified in the autism group, while no significant associations were evident in the control and social anxiety groups.
### Activity Impact on Motivation
These findings are important because they reveal how activities impact mental well-being differently for individuals with autism, social anxiety, and those without these conditions. For the control group, the positive correlation with seven-day average park visits suggests outdoor activities benefit overall well-being. Conversely, the negative correlation with grocery store visits for the autism group highlights the stress linked to routine tasks like grocery shopping. Understanding these differences is key to designing tailored interventions. For example, promoting park visits could boost well-being in the general population, while reducing stress in grocery environments could aid autistic individuals. The lack of significant results for specific locations in the social anxiety group suggests that overall activity levels, rather than specific locations, may be more crucial to their well-being.