View source: R/Calculate_TRI.R
Calculate_TRI | R Documentation |
Calculate_TRI
calculates the Titer Response Index (TRI)
Calculate_TRI( dat_list, subjectCol = "SubjectID", discretize = c(0.2, 0.3), responseLabels = paste0(c("low", "moderate", "high"), "Responder"), na_action = "na.fail", ... )
dat_list |
a named list like the one returned by |
subjectCol |
the name of the column specifying a subject ID. Default is "SubjectID". |
discretize |
a vector of quantiles in (0, 0.5] specifying where to make the cutoff for low, moderate and high responses. Default is 20% and 30%. |
responseLabels |
names for low, moderate and high responses |
na_action |
how should missing |
... |
Additional arguments passed to |
Calculates the Titer Response Index (TRI) defined in Bucasas et al. 2011
Missing (NA
) values are handled by being returned as missing in the
endpoints in the output
A list with the following elements:
the models calculated on each strain separately (with names the same as on dat_list
)
the matrix of residuals
a data frame containing the four scores (before scaling)
a named vector containing the continuous TRI endpoint
a named vector containing the discrete TRI endpoint with cutoffs defined by the <X>% quantile (may be more than 1, see discretize
)
Stefan Avey
Bucasas KL, et al. (2011) Early patterns of gene expression correlate with the humoral immune response to influenza vaccination in humans. J Infect Dis 203(7):921-9.
lm
## Prepare the data titer_list <- FormatTiters(Year2_Titers) ## Calculate the titer response index (TRI) endpoints <- Calculate_TRI(titer_list) summary(endpoints) ## Get discrete endpoints using upper/lower 30% endpoints$TRI_d30 ## Recreate Supp. Fig. S1 pairs(endpoints$scores, col = endpoints$TRI_d30)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.