Nothing
intraarm_postprocessres <- function(data_df, fit_res){
m2resloglik <- sapply(fit_res, function(x){-2*x$mgls$logLik})
s_mgls <- lapply(fit_res, function(x){summary(x$mgls)})
aic <- sapply(s_mgls, "[[", "AIC")
var_res <- sapply(fit_res, function(x){x$mgls$sigma^2})
sigmas <- sapply(fit_res, function(x){stats::coef(x$mgls$modelStruct$varStruct, uncons = FALSE, allCoef = TRUE) * x$mgls$sigma})
vars <- t(cbind(sigmas^2))
colnames(vars) <- levels(data_df$stim)
# model output ----
res_lik <- cbind("AIC" = aic, "-2 Res. logLikelihood" = m2resloglik)
res_2plot <- lapply(fit_res, function(x){x$res_tab[grep("Vaccine effect", rownames(x$res_tab)), ]})
res_2plot <- lapply(res_2plot, function(y){
temp <- cbind.data.frame(do.call(rbind, lapply(strsplit(gsub("on response in stimulation ", "",
sapply(strsplit(rownames(y), "Vaccine effect "), "[", 2)),
" at "),
function(x){c(x[1], strsplit(x[2], " compared to baseline ")[[1]][1])})),
"pvalue" = y[, "p-value"])
rownames(temp) <- NULL
colnames(temp)[1:2] <- c("Stimulation", "Timepoint")
return(temp)
})
pval_2plot <- make_nice_pvals(do.call(rbind.data.frame, res_2plot), data_df, auxvar = "time")
#maybe TODO compute group2 correctly when more than 2 Timepoints
return(list(
"vars" = vars,
"pval_2plot" = pval_2plot,
"res_lik" = res_lik,
"res_2plot" = res_2plot,
"pval_2plot" = pval_2plot
))
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.