View source: R/get.chisq.stats.R
get.chisq.stats | R Documentation |
Applies survdiff on different prognoses groups and computes Logrank P using chisquare statistics.
get.chisq.stats(groups, survobj)
groups |
Grouping of patients (passed directly to survdiff, so factors & continuous variables are okay) |
survobj |
An object of class Surv (from the survival package) – patient ordering needs to be identical as for groups |
A vector containing: Chisq, degrees of freedom (DOF) and Logrank P-value.
Syed Haider
survtime <- sample(seq(0.1,10,0.1), 100, replace = TRUE); survstat <- sample(c(0,1), 100, replace = TRUE); survobj <- Surv(survtime, survstat); groups <- sample(c('A','B'), 100, replace = TRUE); get.chisq.stats( groups = as.factor(groups), survobj = survobj );
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.