powered by
Penalized Spline model
penalized_spline_model( data, s = "bs", link = "logit", framework = "pl", sp = NULL )
a list of class penalized_spline_model with 6 attributes
type of datatype used for model fitting (aggregated or linelisting)
the dataframe used for fitting the model
either pl or glmm
fitted "gam" model when framework is pl or "gamm" model when framework is glmm
seroprevalence
force of infection
the input data frame, must either have `age`, `pos`, `tot` column for aggregated data OR `age`, `status` for linelisting data
smoothing basis to use
link function to use
which approach to fit the model ("pl" for penalized likelihood framework, "glmm" for generalized linear mixed model framework)
smoothing parameter
[mgcv::gam()], [mgcv::gamm()] for more information the fitted gam and gamm model
data <- parvob19_be_2001_2003 data$status <- data$seropositive model <- penalized_spline_model(data, framework="glmm") model$info$gam plot(model)
Run the code above in your browser using DataLab