Learn R Programming

refund (version 0.1-40)

apply_sandwich_correction: Apply sandwich correction to model covariance matrices

Description

Applies either observation-level HC sandwich (via [mgcv::vcov.gam()]) or cluster-robust sandwich (CR1 via [gam_sandwich_cluster()] or CL2 via [gam_sandwich_cluster_cl2()]) to a fitted pffr model.

Usage

apply_sandwich_correction(m, algorithm, type = "cluster")

Value

Model with corrected covariance matrices.

Arguments

m

Fitted model.

algorithm

Algorithm symbol.

type

`"cluster"` (default) for CR1 cluster-robust, `"cl2"` for leverage-adjusted cluster-robust CL2, or `"hc"` for observation-level HC.