Learn R Programming

gKRLS (version 1.0.3)

estfun.gam: Estimating Robust/Clustered Standard Errors with mgcv

Description

This extracts the score of the log-likelihood for each observation for a model estimated using gam or bam. It is necessary to allow mgcv to work correctly with functions from sandwich to product cluster or robust standard errors.

Usage

# S3 method for gam
estfun(x, correct_df = TRUE, override_check = FALSE, ...)

Value

A matrix used internally for sandwich.

Arguments

x

A model estimated using gam or bam.

correct_df

The default, TRUE, adjusts sandwich to use the effective degrees of freedom for k instead of the number of columns of the design. FALSE uses k.

override_check

The default, FALSE, allows this function to be used inside of sandwich. If only the matrix of scores is required, set to TRUE.

...

Not used for estfun.gam.