# ChA8-IntSurvDiff: Weighted Integrated Survival function test In PwrGSD: Power in a Group Sequential Design

## Description

Computes a two sample weighted integrated survival function log-rank statistic with events weighted according to one of the available weighting function choices

## Usage

 ```1 2``` ``` IntSurvDiff(formula = formula(data), data = parent.frame(), WtFun = c("FH", "SFH", "Ramp"), param = c(0, 0), sided = c(2, 1), subset, na.action, w = FALSE) ```

## Arguments

 `formula` a formula of the form `Surv(Time, Event) ~ arm` where `arm` is a dichotomous variable with values 0 and 1. `data` a dataframe `WtFun` a selection from the available list: “FH” (Fleming-Harrington), “SFH” (stopped Fleming-Harrington) or “Ramp”. See `param` in the following line. `param` Weight function parameters. Length and interpretation depends upon the selected value of `WtFun`: If `WtFun==FH` then `param` is a length 2 vector specifying the power of the pooled (across arms) kaplan meier estimate and its complement. If `WtFun==SFH` then `param` is a length 3 vector with first two components as in the “FH” case, and third component the time (in the same units as the time to event) at which the “FH” weight function is capped off at its current value. If `WtFun==SFH` then `param` is of length 1 specifying the time (same units as time to event) at which events begin to get equal weight. The “Ramp” weight function is a linearly increasing deterministic weight function which is capped off at 1 at the user specified time. `sided` One or Two sided test? Set to 1 or 2 `subset` Analysis can be applied to a subset of the dataframe based upon a logical expression in its variables `na.action` Method for handling `NA` values in the covariate, `arm` `w` currently no effect

## Value

An object of class `survtest` containing components

 `pn` sample size `wttyp` internal representation of the `WtFun` argument `par` internal representation of the `param` argument `time` unique times of events accross all arms `nrisk` number at risk accross all arms at each event time `nrisk1` Number at risk in the experimental arm at each event time `nevent` Number of events accross all arms at each event time `nevent1` Number of events in the experimental arm at each event time `wt` Values of the weight function at each event time `pntimes` Number of event times `stat` The un-normalized weighted log-rank statistic, i.e. the summed weighted observed minus expected differences at each event time `var` Variance estimate for the above `pu0` person units of follow-up time in the control arm `pu1` person units of follow-up time in the intervention arm `n0` events in the control arm `n1` events in the intervention arm `n` sample size, same as `pn` `call` the call that created the object

## Author(s)

Grant Izmirlian <[email protected]

## References

Weiand S, Gail MH, James BR, James KL. (1989). A family of nonparametric statistics for comparing diagnostic makers with paired or unpaired data. Biometrika 76, 585-592.

`wtdlogrank`
 ```1 2 3``` ``` library(PwrGSD) data(lung) fit.isd <- IntSurvDiff(Surv(time, I(status==2))~I(sex==2), data=lung, WtFun="SFH", param=c(0,1,300)) ```