Description Usage Arguments Examples
Models the force of infection using semi-parametric regression models, given input parameters and the specification of a model (see arguments). For more details on the B-splines approach, go to help("pspline.fit").
1 | SemiParametricRegression(parameters, fun)
|
parameters |
Contains all the parameters of a model: y represents a vector of the immunological statuses of all individuals with regard to the pathogen under consideration, a is a vector of the ages of all individuals at the time of data collection, and s is a vector containing information about the individual's sex (as categorical variable). On top of that, approach-specific parameters should be specified. SmoothSplines requires the specification of the dfopts parameter (the target equivalent degrees of freedom, used as a smoothing parameter) and link parameter (“logit” or “cloglog”). CubicRegSplines, ThinPlateRegSplines, CubicRegSplinesMM, and ThinPlateRegSplinesMM require that one specifies the link parameter (“logit” or “cloglog”). |
fun |
This specifies which semiparametric regression model you want to use: SmoothSplines avoids knot selection problems by using the maximal set of knots. CubicRegSplines joins (cubic) polynomials at the knots of the spline to ensure continuity and differentiablility up to degree two. ThinPlateRegSplines does not use knots, is computationaly harder but provides nested models which for building models is in line with general linear modeling methods. CubicRegSplinesMM and ThinPlateRegSplinesMM are the same as CubicRegSplines and ThinPlateRegSplines, but model parameter estimation is performed using the GLMM framework and the PQL-estimation method. AdaptiveSplineSmoothing employs the Laplace approximation to fit an adaptive penalized spline in the GLMM framework. |
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 62 63 | # Load Belgian B19 data
data("VZV_B19_BE_0103")
subset<-(VZV_B19_BE_0103$age>0.5)&(VZV_B19_BE_0103$age<76)&(!is.na(VZV_B19_BE_0103$age))&
!is.na(VZV_B19_BE_0103$parvores)
VZV_B19_BE_0103<-VZV_B19_BE_0103[subset,]
y<-VZV_B19_BE_0103$parvores[order(VZV_B19_BE_0103$age)]
a<-VZV_B19_BE_0103$age[order(VZV_B19_BE_0103$age)]
# Smoothing splines, with logit link-function
dfopts <- 3.5
params <- list(y=y, a=a, dfopts=dfopts, link="logit")
result <- SemiParametricRegression(params, SmoothSplines)
# Smoothing splines, with cloglog link-function
dfopts <- 4.5
params <- list(y=y, a=a, dfopts=dfopts, link="cloglog")
result <- SemiParametricRegression(params, SmoothSplines)
# Cubic regression splines, with logit link-function
params <- list(y=y, a=a, link="logit")
result <- SemiParametricRegression(params, CubicRegSplines)
# Cubic regression splines, with cloglog link-function
params <- list(y=y, a=a, link="cloglog")
result <- SemiParametricRegression(params, CubicRegSplines)
# Thin Plate regression splines, with logit link-function
params <- list(y=y, a=a, link="logit")
result <- SemiParametricRegression(params, ThinPlateRegSplines)
# Thin Plate regression splines, with cloglog link-function
params <- list(y=y, a=a, link="cloglog")
result <- SemiParametricRegression(params, ThinPlateRegSplines)
# Cubic regression splines, with logit link-function and gamm
params <- list(y=y, a=a, link="logit")
result <- SemiParametricRegression(params, CubicRegSplinesMM)
# Cubic regression splines, with cloglog link-function and gamm
params <- list(y=y, a=a, link="cloglog")
result <- SemiParametricRegression(params, CubicRegSplinesMM)
# Thin Plate regression splines, with logit link-function and gamm
params <- list(y=y, a=a, link="logit")
result <- SemiParametricRegression(params, ThinPlateRegSplinesMM)
# Thin Plate regression splines, with cloglog link-function and gamm
params <- list(y=y, a=a, link="cloglog")
result <- SemiParametricRegression(params, ThinPlateRegSplinesMM)
# Adaptive Spline Smoothing
library(AdaptFit)
kn.mean <- default.knots(a, 20)
kn.var <- default.knots(a,5)
params <- list(y=y, a=a, adap=TRUE, knots=kn.mean, var.knot=kn.var)
result <- SemiParametricRegression(params, AdaptiveSplineSmoothing)
# Adaptive Spline Smoothing
library(AdaptFit)
kn.mean <- default.knots(a, 20)
kn.var <- default.knots(a,5)
params <- list(y=y, a=a, adap=FALSE, knots=kn.mean)
result <- SemiParametricRegression(params, AdaptiveSplineSmoothing)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.