View source: R/plotForestParamMV.R
plotForestParamMV | R Documentation |
Calculates a multivariate analysis, either utilizing all provided variables supplied in the data data.frame (default), using the step function for model selection to obtain variables (selection takes values expected by the direction parameter of step) or retaining only variables which show a likelhood ratio p-value below a supplied cutoff in the univariate analysis. Errors might occur if the graphic devices dimension is too small (foresplot() fails).
plotForestParamMV(
srv,
data,
subject = NULL,
selection = F,
title = "",
col = c("royalblue", "darkblue", "royalblue"),
dist = "weibull",
recalc = F,
MDPI = F
)
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. |
subject |
vector identifying independent subjects. Does not work with automatic model selection. |
title |
Plot title |
col |
Color vector as expected by the forestplot() function |
recalc |
caluclate LRT per factor |
MDPI |
adhere to MDPI requirements |
require(survival)
times <- c(100, 87, 96, 20)
status <- c(1,1,0,1)
srv <- Surv(times, status)
data <- data.frame(Surgery=c("yes","yes","no","no"),
Drug=c("no","yes","yes","yes"),
Sex=c("M","F","F","F"),
Age=c(60,65,50,75))
subjectIDs <- c(1,2,3,3)
#Use all variables
#plotForestMV(srv,data)
#Univariate Cutoff of p-val < 0.2
#plotForestMV(srv, data, selection=0.2)
#Automatic modell selection
#plotForestMV(srv, data, selection="both")
#Observatons from the same individual
#plotForestMV(srv, data, subject=subjectIDs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.