km.est.pi: Inverse Probabilty of Treatment Weighting

Description Usage Arguments Value Examples

View source: R/km.est.pi.R

Description

Estimate survival probabilities by IPTW

Usage

1
km.est.pi(y,delta,treat,x,treat.select,t,standardize=FALSE)

Arguments

y

a numeric vector of observed time

delta

a factor vector of indicator for events

treat

a factor vector of the treatment indicator

x

an optional covariance matrix containing the variables in the model

treat.select

a value of 1 (treatment) or 0 (control)

t

a numeric vector of time points for estimation

standardize

a logical object of whether the covariance matrix x would be centered and scaled, default by FALSE

Value

A list containing the following components:

St

point estimates of survival probability (S(t)) at t

sd

standard deviation of survival probability (S(t)) at t

Examples

1
2
3
4
5
6
7
8
library(survival)
y <- as.matrix(gbsg$rfstime/(365.25/12))
treat <- data.matrix(gbsg$hormon)
delta <- as.matrix(gbsg$status)
x <- data.matrix(gbsg[,c("age","meno","size","grade","nodes","pgr","er")])
t <- seq(0,80,2)

km.est.pi(y=y,delta=delta,treat=treat,x=x,treat.select=1,t=t,standardize=FALSE)

kimihua1995/adjKMtest documentation built on Jan. 1, 2021, 7:20 a.m.