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
either a character vector or a list supplying the names of covariates, and possibly their values, to condition up. The order of the values determines how these are plotted via the
draw.conditional_values()method; the first element is mapped to the x channel, the second element to the colour channel, the third toggplot2::facet_wrap()if no fourth element is present, if present, the fourth element is mapped to the rows and the third element is mapped to the columns ofggplot2::facet_grid().- 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
numeric; number of values to generate for numeric variables named in
condition.- 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().

