data(hivDK)
# Convert the dates to fractional years so that rates are
# expressed in cases per year and not per day
for(i in 2:4) hivDK[,i] <- cal.yr(hivDK[,i])
# multiplicative rate ratio model, baseline rates and RRs
m.RR <- Icens(entry, well, ill,
model = "MRR",
formula = ~ pyr + us,
breaks = seq(1980, 1990, 5),
data = hivDK)
# the MRR model returns a list with 2 glm objects.
round(ci.lin(m.RR$rates), 4) # rates per 1 year
round(ci.lin(m.RR$cov, Exp=TRUE), 4) # RRs
# There is a print method that does the job:
print(m.RR)
# and scales only the rate parameters, here per 10 years
print(m.RR, scale = 10)
# additive excess rate model, baseline rates and excess rates
m.ER <- Icens(entry, well, ill,
model = "AER",
formula = ~ pyr + us,
breaks = seq(1980, 1990, 5),
data = hivDK)
# The print method returns rates per 1 year:
print(m.ER)
# or per 10 years:
print(m.ER, scale = 10)
Run the code above in your browser using DataLab