get_term_legacy: Extract a partial effect for models without a '$smooth'...

View source: R/get-terms.R

get_term_legacyR Documentation

Extract a partial effect for models without a $smooth component

Description

Fallback used for fits such as coxph that support predict(type = "terms") but expose no mgcv smooth metadata. Matching is anchored to the variable name (exact, or as a parenthesised argument such as pspline(karno)) rather than an unanchored substring.

Usage

get_term_legacy(data, fit, term, n = 100, conf_level = 0.95, ...)

Arguments

data

A data frame containing variables used to fit the model. The first row is used as the basis for all covariates other than the one being varied (their values are irrelevant for the term-wise contribution).

fit

A fitted object of class gam.

term

A character string naming the model term/variable.

n

Number of points at which to evaluate the smooth over the range of its covariate.

conf_level

The confidence level for the pointwise confidence interval.

...

Further arguments (currently unused).


pammtools documentation built on Aug. 27, 2026, 1:08 a.m.