Description Usage Arguments Details Examples

View source: R/fast_pseudo_mean.R

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

1 | ```
fast_pseudo_mean(time, event, tmax)
``` |

`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. |

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.

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))
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.