powered by
Proportional hazards regression with piecewise constant hazards and tabular data.
tpchreg(formula, data, time, weights, last, subset, na.action, contrasts = NULL, start.coef = NULL, control = list(epsilon = 1.e-8, maxit = 200, trace = FALSE))
a formula with 'oe(count, exposure) ~ x1 + ...'
a data frame with occurrence/exposure data plus covariates.
the time variable, a factor character vector indicating time intervals, or numeric, indicating the start of intervals.
Case weights.
If time is numeric, the closing of the last interval.
time
subset of data, not implemented yet.
Not implemented yet.
For the moment equal to zero, not used.
list of control parameters for the optimization.
oe.
oe
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)
Run the code above in your browser using DataLab