Skip to content
This repository has been archived by the owner on Apr 20, 2019. It is now read-only.

kshedden/duration

Repository files navigation

This repository is no longer being actively developed. See here for the new version of this package.

The duration package supports fitting statistical models for event time data (also known as "survival analysis") in Go.

Currently, proportional hazards regression ("Cox models"), Kaplan-Meier estimates of the marginal survival function, and estimation of the cumulative incidence function are supported. The analysis functions accept data using the dstream interface.

Link to the godoc documentation.

Here is an example of a proportional hazards regression:

// Prepare a design matrix using a formula
fml := "age + sex + severity + age*sex + age*severity"
dx := formula.New(fml, dx).Keep("Entry", "Time", "Status").Done()
da = dstream.MemCopy(dx)

// Fit the model
ph := NewPHReg(da, "Time", "Status").Entry("Entry").Done()
rslt := ph.Fit()
fmt.Printf("%s\n", rslt.Summary())

Features

  • Support for entry times (delayed entry) and stratification

About

Survival analysis and other statistical duration models in Golang (Go)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages