plotForestSubgroup: Calculated univariate analysis and creates a forest plot

View source: R/plotForestSubgroup.R

plotForestSubgroupR Documentation

Calculated univariate analysis and creates a forest plot

Description

The function creates a forest plot for a given number of variables, expect a srv object and a data.frame containing the selected variables as columns. Univariate Cox PH models are fitted. A subject vector can be specified to allow for the analysis of multiple observations per patient (e.g. paired samples), by using marginal model [cluster(subject)]. Errors might occur if the graphic devices dimension is too small (foresplot() fails).

Usage

plotForestSubgroup(
  srv,
  data,
  ref = NULL,
  title = "",
  col = c("royalblue", "darkblue", "royalblue")
)

Arguments

srv

Survival object as created by survival::Surv() function, each observation is linked to one row of the data parameter

data

data.frame containing all variables which will be analyzed. The class of each column determined the type of analysis: numeric cols will be treated as continous variable, factor and character as factors.

title

Plot title

col

Color vector as expected by the forestplot() function

subject

vector identifying independent subjects

invalCut

Cutoff to set HR, CI and p-values to empty values if HR exceeds the provided cutoff (e.g. if models do not converge)

removeInval

Retain as invalid identified levels (invalCut)


mknoll/dataAnalysisMisc documentation built on Nov. 17, 2024, 9:40 a.m.