Hide code
library(tidyverse)
library(INLA)
library(here)
library(pals)
[1] "2023-06-26"
# add variables
antem_df <- antem_df %>%
mutate(hpdi = as.numeric(difftime(date, min_date, units = "hours")), # hours post donor inoculation
hpe = dpe*24, # convert dpe to hpe
exp_type = if_else(group == "donor", "inoc", "cont"), # exposed by inoculation or direct contact
fever = if_else(temp >= 104, "fever", "no_fever"), # temp >= 104 constitutes fever
censor_status = if_else(group == "Group 1" | animal == "BR23-24", 0, 1), # No obs symptoms (0) in these
)
dim(antem_df)
[1] 168 14
To evaluate the differences in nasal, serum, and lesion score among groups and over time, repeated measures ANOVAs were applied using the ezANOVA() function from the ez R-package. The analyses included within-subjects (days post-exposure, dpe) and between-subjects (group) factors, with nasal, serum, and lesion scores as the dependent variables. Mauchly’s test was conducted to test the assumption of sphericity. Where violations were found, Greenhouse-Geisser and Huynh-Feldt corrections were applied.
The repeated measures ANOVA results for nasal, serum, and lesion scores were significant. For nasal virus quantity, there were significant main effects of group (F(2, 9) = 9.22, p = 0.0066) and days post-exposure (dpe) (F(6, 54) = 33.99, p < 0.0001), as well as a significant interaction between group and dpe (F(12, 54) = 5.53, p < 0.0001), suggesting that nasal virus quantity varied significantly across groups and time, with different temporal patterns among groups. For serum virus quantity, no significant main effect of group was found (F(2, 9) = 2.79, p = 0.114), but there were significant effects of dpe (F(6, 54) = 25.18, p < 0.0001) and the group by dpe interaction (F(12, 54) = 7.95, p < 0.0001), indicating significant changes over time and different temporal patterns among groups. Lesion scores showed significant main effects of group (F(2, 9) = 5.86, p = 0.023) and dpe (F(6, 54) = 45.87, p < 0.0001), and a significant interaction between group and dpe (F(12, 54) = 3.04, p = 0.0025), indicating significant differences in lesion severity across groups and over time, with varying temporal patterns among the groups.
Prepare Data
contact_groups <- antem_df %>%
filter(group %in% c("Group 2", "Group 3", "Group 4")) %>%
select(animal, group, nasal, serum, dpe, score) %>%
mutate(
score = replace_na(score, 0)) %>%
drop_na() %>%
mutate(
score = replace_na(score, 0),
nasal = replace(nasal, nasal == 45, 0),
serum = replace(serum, serum == 45, 0),
dpe = as.factor(dpe),
animal = as.factor(animal),
group = as.factor(group)
) %>%
as.data.frame()
Results indicate that nasal virus quantity differed significantly between the groups and across the days post-exposure, with an interaction effect suggesting that the temporal pattern of virus quantity varied among the groups.
$ANOVA
Effect DFn DFd F p p<.05 ges
2 group 2 9 9.223642 6.619789e-03 * 0.2693092
3 dpe 6 54 33.985994 1.195097e-16 * 0.7559307
4 group:dpe 12 54 5.531737 4.748785e-06 * 0.5020495
$`Mauchly's Test for Sphericity`
Effect W p p<.05
3 dpe 0.002507464 0.007421478 *
4 group:dpe 0.002507464 0.007421478 *
$`Sphericity Corrections`
Effect GGe p[GG] p[GG]<.05 HFe p[HF] p[HF]<.05
3 dpe 0.4698995 7.240063e-09 * 0.7063488 2.378893e-12 *
4 group:dpe 0.4698995 1.041644e-03 * 0.7063488 9.172502e-05 *
Results suggest that while there were no significant differences between groups, there were significant changes over time, and the pattern of these changes differed significantly among the groups.
$ANOVA
Effect DFn DFd F p p<.05 ges
2 group 2 9 2.789541 1.141052e-01 0.1386202
3 dpe 6 54 25.182482 5.082150e-14 * 0.6744439
4 group:dpe 12 54 7.951312 2.761527e-08 * 0.5667711
$`Mauchly's Test for Sphericity`
Effect W p p<.05
3 dpe 1.265279e-05 6.228482e-08 *
4 group:dpe 1.265279e-05 6.228482e-08 *
$`Sphericity Corrections`
Effect GGe p[GG] p[GG]<.05 HFe p[HF] p[HF]<.05
3 dpe 0.2446423 7.610504e-05 * 0.2805428 2.727829e-05 *
4 group:dpe 0.2446423 2.894414e-03 * 0.2805428 1.633022e-03 *
Results indicate that lesion scores differed significantly between the groups and across the days post-exposure, with an interaction effect suggesting that the temporal pattern of lesion severity varied among the groups.
$ANOVA
Effect DFn DFd F p p<.05 ges
2 group 2 9 5.860606 2.345433e-02 * 0.2550442
3 dpe 6 54 45.873199 1.823174e-19 * 0.7897890
4 group:dpe 12 54 3.038905 2.531711e-03 * 0.3323484
$`Mauchly's Test for Sphericity`
Effect W p p<.05
3 dpe 6.163627e-19 5.763765e-47 *
4 group:dpe 6.163627e-19 5.763765e-47 *
$`Sphericity Corrections`
Effect GGe p[GG] p[GG]<.05 HFe p[HF] p[HF]<.05
3 dpe 0.4739793 2.829807e-10 * 0.7157848 1.639730e-14 *
4 group:dpe 0.4739793 2.364298e-02 * 0.7157848 8.310038e-03 *