Learn R Programming

nparsurv (version 0.1.0)

nparsurv_test: Nonparametric Tests for Main Effects, Simple Effects and Interaction Effect in a Two-Factorial Design with Censored Data

Description

The nparsurv_test function calculates the test statistics and the p-values as described in 'Nonparametric Methods for Factorial Designs with Censored Data' by Akritas and Brunner.

Usage

nparsurv_test(data)

Arguments

data
A data.frame of the form (time, status, factorA, factorB)

Missing values must be saved as NA.

Value

A nparsurv_test object containing the following components: object containing the following components:

Details

The package provides tests for a survival setting with two influencing variables, that are factors with at least two levels each. Details are shown in 'Nonparametric Methods for Factorial Designs with Censored Data' by Akritas and Brunner. The nparsurv_test function returns the values of the five test statistics: the tests for main effects, simple effects and the interaction effect. Additionally, based on the asymptotic chi-square distribution of the test statistic under the nullhypothesis, p-values are computed.

References

Michael G. Akritas, Edgar Brunner(1997). Nonparametric Methods for Factorial Designs with Censored Data. Journal of the American Statistical Association.

Examples

Run this code
data_ovarian<-data.frame(survival::ovarian$futime,
                       survival::ovarian$fustat,
                       as.factor(survival::ovarian$resid.ds),
                       as.factor(survival::ovarian$rx))
nparsurv_test(data_ovarian)

data_GBSG2<-data.frame(TH.data::GBSG2$time,
                       TH.data::GBSG2$cens,
                       TH.data::GBSG2$tgrade,
                       TH.data::GBSG2$horTh)
nparsurv_test(data_GBSG2)

Run the code above in your browser using DataLab