Calculate_TRI: Calculate TRI

View source: R/Calculate_TRI.R

Calculate_TRIR Documentation

Calculate TRI

Description

Calculate_TRI calculates the Titer Response Index (TRI)

Usage

Calculate_TRI(
  dat_list,
  subjectCol = "SubjectID",
  discretize = c(0.2, 0.3),
  responseLabels = paste0(c("low", "moderate", "high"), "Responder"),
  na_action = "na.fail",
  ...
)

Arguments

dat_list

a named list like the one returned by FormatTiters.

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 NA values be treated. Default is "na.fail"

...

Additional arguments passed to lm

Details

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

Value

A list with the following elements:

models

the models calculated on each strain separately (with names the same as on dat_list)

residualMatrix

the matrix of residuals

scores

a data frame containing the four scores (before scaling)

TRI

a named vector containing the continuous TRI endpoint

TRI_d<X>

a named vector containing the discrete TRI endpoint with cutoffs defined by the <X>% quantile (may be more than 1, see discretize)

Author(s)

Stefan Avey

References

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.

See Also

lm

Examples

## 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)

stefanavey/titer documentation built on Jan. 27, 2023, 3:41 a.m.