ProportionalHazards: Estimating Age-Time Dependent Prevalence and Force of...

Description Usage Arguments Examples

Description

The use of serological surveys is nowadays a common way to study the epidemiology of many infections. In case a single cross-sectional survey is available, one needs to assume that the disease is in steady state. While reasonable for some infections, this assumption might be untenable for other situations. Models such as the proportional hazards model of Nagelkerke et al. (1999) estimate age- and time-specific prevalence and force of infection from a series of prevalence surveys.

Usage

1

Arguments

formula

A GAM formula, or a list of formulae (see formula.gam and also gam.models). These are exactly like the formula for a GLM except that smooth terms, s, te, ti and t2, can be added to the right hand side to specify that the linear predictor depends on smooth functions of predictors (or linear functionals of these).

family

This is a family object specifying the distribution and link to use in fitting etc (see glm and family). See family.mgcv for a full list of what is available, which goes well beyond exponential family. Note that quasi families actually result in the use of extended quasi-likelihood if method is set to a RE/ML method (McCullagh and Nelder, 1989, 9.6).

...

See gam.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
library(mgcv)
# Load Dutch Tuberculosis Data
data("TB_NED_6673")
a <- TB_NED_6673$AGE
birthyear <- TB_NED_6673$BRTHYR
x <- birthyear-min(birthyear)
xf <- as.factor(birthyear)
g <- TB_NED_6673$SEX
ts <- a+birthyear
s <- TB_NED_6673$PPD
p <- s/TB_NED_6673$N
f <- TB_NED_6673$N-s
y <- cbind(s,f)

# Model 1 (parametric model) (Ades and Noke)
gamfit <- gam(y~a+x,family=binomial(link="cloglog"))
cbind(sum(gamfit$edf),AIC(gamfit),AIC(gamfit, k = log(nrow(y))))

# Model 2 (parametric model) (Ades and Noke)
gamfit=gam(y~a+x+g,family=binomial(link="cloglog"))
cbind(sum(gamfit$edf),AIC(gamfit),AIC(gamfit, k = log(nrow(y))))

# Model 3 (parametric model) (Ades and Noke)
gamfit=gam(y~a*x+g,family=binomial(link="cloglog"))
cbind(sum(gamfit$edf),sum(gamfit$edf),sum(gamfit$edf),AIC(gamfit),AIC(gamfit, k = log(nrow(y))))

# Model 4 (semi-parametric model) (Nagelkerke)
gamfit=gam(y~s(a)+x,family=binomial(link="cloglog"))
cbind(sum(gamfit$edf),AIC(gamfit),AIC(gamfit, k = log(nrow(y))))

# Model 5 (semi-parametric model) (Nagelkerke)
gamfit=gam(y~s(a)+x+g,family=binomial(link="cloglog"))
cbind(sum(gamfit$edf),AIC(gamfit),AIC(gamfit, k = log(nrow(y))))

# Model 6 (semi-parametric model) (Nagelkerke)
gamfit=gam(y~s(a)+x*g,family=binomial(link="cloglog"))
cbind(sum(gamfit$edf),AIC(gamfit),AIC(gamfit, k = log(nrow(y))))

# Model 7 (non-parametric model)
gamfit=gam(y~s(a)+s(x),family=binomial(link="cloglog"))
cbind(sum(gamfit$edf),AIC(gamfit),AIC(gamfit, k = log(nrow(y))))

# Model 8 (non-parametric model)
gamfit=gam(y~s(a)+s(x)+g,family=binomial(link="cloglog"))
cbind(sum(gamfit$edf),AIC(gamfit),AIC(gamfit, k = log(nrow(y))))

# Model 9 (non-parametric model)
gamfit=gam(y~s(a)+s(x)+s(x,by=g)+g,family=binomial(link="cloglog"))
cbind(sum(gamfit$edf),AIC(gamfit),AIC(gamfit, k = log(nrow(y))))

# Model 10 (non-proportional hazard)
gamfit=gam(y~s(a,x),family=binomial(link="cloglog"))
c(sum(gamfit$edf),AIC(gamfit),AIC(gamfit, k = log(nrow(y))))

# Model 11 (non-proportional hazard)
gamfit=gam(y~s(a,x)+g,family=binomial(link="cloglog"))
cbind(sum(gamfit$edf),AIC(gamfit),AIC(gamfit, k = log(nrow(y))))

# Model 12 (non-proportional hazard)
gamfit=gam(y~s(a,x)+g+s(a,x,by=g),family=binomial(link="cloglog"))
c(sum(gamfit$edf),AIC(gamfit),AIC(gamfit, k = log(nrow(y))))

TeaKov/serostat documentation built on May 21, 2019, 1:21 p.m.