# \donttest{
library(dplyr)
if (requireNamespace("lme4", quietly = TRUE) & requireNamespace("lmerTest", quietly = TRUE)){
lmer_results <- olink_lmer(df = npx_data1,
variable=c("Time", 'Treatment'),
random = c('Subject'))
assay_list <- lmer_results %>%
filter(Threshold == 'Significant' & term == 'Time:Treatment') %>%
select(OlinkID) %>%
distinct() %>%
pull()
results_lmer_posthoc <- olink_lmer_posthoc(df = npx_data1,
olinkid_list = assay_list,
variable=c("Time", 'Treatment'),
effect = 'Time:Treatment',
random = 'Subject',
verbose = TRUE)
#Estimate treated vs untreated at each timepoint
results_lmer_posthoc <- olink_lmer_posthoc(df = npx_data1,
olinkid_list = assay_list,
model_formula = "NPX~Time*Treatment+(1|Subject)",
effect_formula = "pairwise~Treatment|Time",
verbose = TRUE)
}
# }
Run the code above in your browser using DataLab