A thin wrapper around `gam`

, however, some arguments are
prespecified:
`family=poisson()`

, `offset=data$offset`

and `method="REML"`

.
The first two can not be overwritten. The `method`

argument
can be specified as usual, but defaults to `GCV.cp`

in
`gam`

.

pamm(
formula,
data = list(),
method = "REML",
...,
trafo_args = NULL,
engine = "gam"
)
is.pamm(x)
# S3 method for pamm
print(x, ...)
# S3 method for pamm
summary(object, ...)
# S3 method for pamm
plot(x, ...)

## 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). |

data |
A data frame or list containing the model response variable and
covariates required by the formula. By default the variables are taken
from `environment(formula)` : typically the environment from
which `gam` is called. |

method |
The smoothing parameter estimation method. `"GCV.Cp"` to use GCV for unknown scale parameter and
Mallows' Cp/UBRE/AIC for known scale. `"GACV.Cp"` is equivalent, but using GACV in place of GCV. `"REML"`
for REML estimation, including of unknown scale, `"P-REML"` for REML estimation, but using a Pearson estimate
of the scale. `"ML"` and `"P-ML"` are similar, but using maximum likelihood in place of REML. Beyond the
exponential family `"REML"` is the default, and the only other option is `"ML"` . |

... |
Further arguments passed to `engine` . |

trafo_args |
A named list. If data is not in PED format, `as_ped`
will be called internally with arguments provided in `trafo_args` . |

engine |
Character name of the function that will be called to fit the
model. The intended entries are either `"gam"` or `"bam"`
(both from package `mgcv` ). |

x |
Any R object. |

object |
An object of class `pamm` as returned by `pamm` . |

## See also

## Examples

#>
#> Family: poisson
#> Link function: log
#>
#> Formula:
#> ped_status ~ s(tend) + complications
#>
#> Parametric coefficients:
#> Estimate Std. Error z value Pr(>|z|)
#> (Intercept) -7.8839 0.1969 -40.038 <2e-16 ***
#> complicationsyes 0.2453 0.3420 0.717 0.473
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#> Approximate significance of smooth terms:
#> edf Ref.df Chi.sq p-value
#> s(tend) 1.001 1.003 5.456 0.0196 *
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>
#> R-sq.(adj) = -0.0232 Deviance explained = 1.87%
#> UBRE = -0.79402 Scale est. = 1 n = 1937

#>
#> Family: poisson
#> Link function: log
#>
#> Formula:
#> ped_status ~ s(tend) + complications
#>
#> Estimated degrees of freedom:
#> 1.75 total = 3.75
#>
#> UBRE score: -0.8570005