SummaryTwoGroups: Summary statistics of two-group comparison

Description Usage Arguments Value Note Author(s) Examples

Description

This function returns a summary of two group comparison in terms of effect size, lower and upper limits of CI, and p-value. Three classes of "outcome.var" variable can be analyzed using this function: 1) Cox proportional hazards model for survival outcome.var using coxph() 2) T-test for continuous outcome.var using lm() 3) Z-test for binary outcome.var using prop.test().

Usage

1
2
3
4
5
SummaryTwoGroups(outcome.var, subgroup.var = NULL, treatment.var,
  placebo.code, active.code, outcome.class, alpha = 0.05,
  surv.conf.type = "plain", ties = "efron", covariate.var = NULL,
  strat.factor.var = NULL, return.fit = FALSE,
  fit.para = list(prop.test.use.continuity.correction = T))

Arguments

outcome.var

a vector specifying the outcome variable. For 'binary' outcome.var, it should be a vector of 1 or 0. In case of a 'survival' variable, this will be a matrix of two columns: 1) time to event 2) censorship.

subgroup.var

a vector of row index specifying the subgroup to be included for the analysis. If NULL (default), all data will be used.

treatment.var

the name of the treatment variable.

placebo.code

the name of the control group within the treatment variable.

active.code

the name of the treatment/experimental group within the treatment variable.

outcome.class

the outcome class of the 'outcome.var' variable. One of the 3 values - "survival", "binary", or "continuous".

alpha

the confidence level (CI) for point estimate, i.e. 0.05 (default) for 95 percent CI.

surv.conf.type

confidence interval type. See conf.type in survfit. Default is "plain"

ties

Default is "efron". To match internal sas results, use "exact". See parameter "ties" in coxph.

covariate.var

a vector specifying the covariate variables. This can be added to adjust for in the analysis for survival and continuous outcome.var variable classes. Default is NULL.

strat.factor.var

a vector specifying the stratification variables. This can be added for the survival outcome.var variable class. Default is NULL.

return.fit

if TRUE, returns a table of summary statistics. Default is FALSE.

fit.para

a list of fitting parameters. Currently only 'prop.test.use.continuity.correction' in use. If 'prop.test.use.continuity.correction' = T (default), the 'correct' parameter in prop.test will be set as TRUE.

Value

A named vector of following entries: if binary - Effect.Size (Proportion Difference), Lower, Upper, P, Rsp.Placebo, Rsp.Active, N.Placebo, N.Active, nRsp.Placebo, nRsp.Active; if survival - [Events, N, Median Suvival Time] for each group, Effect.Size (Hazard Ratio), Lower, Upper, Wald P; if continuous - Effect.Size (Mean Difference), Lower, Upper, P.

Note

This function requires "survival" package to call the coxph() function. Two treatment arms are required. Treatment group variable can be forced into a factor. Censorship variable is 1 if an event happened, 0 if censored.

Author(s)

Alexey Pronin [email protected], Ning Leng [email protected], and previous team members (see DESCRIPTION)

Examples

1
2
data(input)
SummaryTwoGroups(outcome.var = input$OS, treatment.var = input$Arm, placebo.code = "CTRL", active.code = "TRT", outcome.class = "continuous",surv.conf.type="plain")

lengning/gClinBiomarker documentation built on May 9, 2019, 2:55 p.m.