get.chisq.stats: Applies survdiff function

View source: R/get.chisq.stats.R

get.chisq.statsR Documentation

Applies survdiff function

Description

Applies survdiff on different prognoses groups and computes Logrank P using chisquare statistics.

Usage

get.chisq.stats(groups, survobj)

Arguments

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

Value

A vector containing: Chisq, degrees of freedom (DOF) and Logrank P-value.

Author(s)

Syed Haider

Examples


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


SIMMS documentation built on April 24, 2022, 5:06 p.m.