fast_pseudo_mean: Calculate pseudo-observations.

Description Usage Arguments Details Examples

View source: R/fast_pseudo_mean.R

Description

Computes pseudo-observations for survival analysis on right-censored data based on restricted mean survival time.

Usage

1
fast_pseudo_mean(time, event, tmax)

Arguments

time

- Vector of follow-up times.

event

- Vector of binary event statuses (0 = alive, 1 = dead).

tmax

- Cut-off point for restricted mean survival time. Defaults to maximum follow-up time.

Details

Using a jacknife procedure and restricted mean survival time, this function calculates pseudo-observations for right-censored survival data. These pseudo-observations can be used as the response variable in a generalized estimating equations model. Missing values are not allowed in the time or event vector. The function is equivalent to the pseudomean() function in the 'pseudo' package, but can handle data sets that are orders of magnitude larger.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Dummy data

id <- c(1, 2, 3, 4)
female <- c(0, 1, 1, 0)
time <- c(23, 45, 38, 66)
event <- c(1, 0, 0, 0)

# Compute pseudo-observations

pseudo = fast_pseudo_mean(time, event, 50)

# Create a data frame

test <- data.frame(id, female, pseudo)

# Fit a regression model

library(geepack)

summary(fit <- geese(pseudo ~ female,
data = test, id=id, jack = TRUE, family=gaussian,
corstr="independence", scale.fix=FALSE))

fastpseudo documentation built on May 29, 2017, 9:11 a.m.