knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

sta545package

The goal of the sta545package is to implement the methods in David Cox's 1972 paper Regression Models and Life Tables for use in a project for the class "STA 545: Statistical Data Mining" at the University of Buffalo.

Installation

You can install the released version of the sta545package from GitHub with:

install.packages("devtools")
devtools::install_github("mathmonster/sta545package")

Examples

Kaplan-Meier Product Limit Estimator:

library(sta545package)
plot(fitkm(remission ~ sample, delta="censor", data=leukemia))

Cox Proportional Hazards Model

Fit a model

fitcox.leukemia <- fitcox(remission ~ sample, delta="censor", data=leukemia)
summary(fitcox.leukemia)

Making predictions

predict(fitcox.leukemia, newdata=leukemia, type="expected")

Calculating the c-index

concordance.fitcox(fitcox.leukemia, newdata=leukemia)

Cross-validated c-index

cv.fitcox(leukemia, fitcox(remission ~ sample, delta="censor", data=leukemia), 5)


mathmonster/sta545package documentation built on Jan. 1, 2021, 9:20 a.m.