calculateResponseScore: Calculates a score based on principle component analysis

View source: R/responseScore.R

calculateResponseScoreR Documentation

Calculates a score based on principle component analysis

Description

The function calcuculates a score for biomarker data represented as time blocks. The score is calculated via PCA.

Usage

calculateResponseScore(
  responseDf,
  idColumn = "PATIENT",
  blockColumn = "block",
  sexColumn = NA,
  responseColumns,
  confounderColumns = NA
)

Arguments

responseDf

the data frame that contains the time blocks and the biomarker data per time block

idColumn

name of ID column

blockColumn

name of time block column

sexColumn

name of column that contains sex information (optional). If provided, the score will be adjusted for sex.

confounderColumns

names of columns that contain confounders (optional). If provided, the score will be adjusted for these confounders using linear regression

responseColumn

names of the columns containing the patient block value for a biomarker (e.g. vector of string names). The score will be based only on these columns.

Value

the response data frame with an added column phenoScore that shows the computed score

Examples

## Not run: 
results <- read_tsv('../data/responseSpreadsheet.txt')

resultsCor <- calculateResponseScore(results,responseColumns = c('sbp','dbp','aerAll','acrAll','egfr'), sexColumn = 'SEX')

## End(Not run)

smm52/timeBlocks documentation built on Nov. 27, 2022, 3:54 a.m.