make.grid: Create a data frame of predictors to display a model

View source: R/wald.R

make.gridR Documentation

Create a data frame of predictors to display a model

Description

Generates the cartesian product of factors and ranges of continuous variables in a model.

Usage

make.grid(mod, n = 50, dmax = 5)

Arguments

mod

a model from which a model data frame can be extracted with getModelData.

n

number of values generated for continuous predictors. Default: 50

dmax

maximum number of distinct values for a numeric variable to be considered discrete. Default: 5

Details

This function is particularly useful to display fitted values of a model that is non-linear in continuous predictors where plotting curves against the original data would produce linear segments instead of a continuous curve.

By default, 50 values of each continuous variable is generated. See the examples to generate fewer values.

Variables are considered discrete if the have fewer than discrete_max distinct values.

Value

a data frame with every combination of the values generated for each variable.


gmonette/spida2 documentation built on Aug. 11, 2024, 7:52 p.m.