Construct covariate combinations using conditional_values() conventions,
then estimate response moments with fitted_moments(). Other covariates are
held at typical values; observations are not averaged over those covariates.
Arguments
- model
a fitted GAM object.
- condition
Character vector or list specifying covariates and optional values. The first covariate supplies the plotting axis, followed by colour, facet columns and facet rows. Grouped surface conditions are not supported.
- data
optional data frame used to generate condition values and determine covariate classes. Explicit values in
conditiontake precedence. Other covariates use the fitted model's typical values. The rows ofdataare not used directly as a prediction grid.- moments
Character vector selecting
"mean","variance","sd","cv","skewness","kurtosis", or"excess_kurtosis"."all"requests all seven. CV is SD divided by a strictly positive mean; kurtosis is the fourth central moment divided by squared variance.- n_vals
Positive integer; number of values to generate along a numeric plotting axis. Defaults to 100. Explicit condition values or helpers override generated values; other numeric conditions use five-number summaries.
- complete
logical; if
TRUE(the default), retain all combinations of conditions. IfFALSE, retain only combinations of factor levels among the variables named inconditionthat occur in the fitted model's data. Numeric conditions are not filtered, and variables absent fromconditionremain at their typical values. Supplieddatadoes not change which combinations count as observed. An error is raised if no combinations remain.- ...
Arguments to
fitted_moments(), includinguncertainty,nuisance,n_draws,seed,scores, andexclude.
Value
A tibble of class "conditional_moments", with the columns returned
by fitted_moments() and the plotting channels of conditional_values().

