Description Usage Arguments Examples
Using a piecewise constant force of infection, monotonicity is often achieved by redefining the age categories over which a constant force of infection is assumed.
1 | pwcfoi(response, x.var, breaks)
|
response |
The response variable. |
x.var |
The predictor variable. |
breaks |
The user chosen categories over which a constant force of infection is assumed. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # Using Bulgarian HAV data
data("HAV_BUL_64_BUL_64")
a<-c(rep(HAV_BUL_64$Age,HAV_BUL_64$Pos),rep(HAV_BUL_64$Age,HAV_BUL_64$Tot-HAV_BUL_64$Pos))
y<-c(rep(rep(1,length(HAV_BUL_64$Age)),HAV_BUL_64$Pos),rep(rep(0,length(HAV_BUL_64$Age)),
HAV_BUL_64$Tot-HAV_BUL_64$Pos))
y<-y[order(a)]
a<-a[order(a)]
grid<-sort(unique(round(a)))
neg<-HAV_BUL_64$Tot-HAV_BUL_64$Pos
pos<-HAV_BUL_64$Pos
tot<-neg+pos
# monotone curve
breaks1<-c(0,10,20,40,60,100)
pcwfit1<-pwcfoi(response=y,x.var=a,breaks=breaks1)
# non-monotone curve
breaks2<-c(0,5,11,18,60,100)
pcwfit2<-pwcfoi(response=y,x.var=a,breaks=breaks2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.