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

View source: R/generic_function.R

estfun.gamR Documentation

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 class 'gam'
estfun(x, correct_df = TRUE, override_check = FALSE, ...)

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.

Value

A matrix used internally for sandwich.


gKRLS documentation built on Sept. 11, 2024, 8:24 p.m.