Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tpchreg

Proportional hazards regression with piecewise constant hazards and tabular data.


Description

Proportional hazards regression with piecewise constant hazards and tabular data.

Usage

tpchreg(formula, data, time, weights, last, subset, na.action, 
contrasts = NULL, start.coef = NULL, 
control = list(epsilon = 1.e-8, maxit = 200, trace = FALSE))

Arguments

formula

a formula with 'oe(count, exposure) ~ x1 + ...'

data

a data frame with occurrence/exposure data plus covariates.

time

the time variable, a factor character vector indicating time intervals, or numeric, indicating the start of intervals.

weights

Case weights.

last

If time is numeric, the closing of the last interval.

subset

subset of data, not implemented yet.

na.action

Not implemented yet.

contrasts

Not implemented yet.

start.coef

For the moment equal to zero, not used.

control

list of control parameters for the optimization.

Note

The interpretation of cuts is different from that in hpch. This is intentional.

See Also

oe.

Examples

sw <- swepop
sw$deaths <- swedeaths$deaths
fit <- tpchreg(oe(deaths, pop) ~ strata(sex) + I(year - 2000), 
time = age, last = 101, data = sw[sw$year >= 2000, ])
summary(fit)

eha

Event History Analysis

v2.10.0
GPL (>= 2)
Authors
Göran Broström [aut, cre], Jianming Jin [ctb]
Initial release
2022-04-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.