Learn R Programming

LMMsolver (version 1.0.13)

makeGrid: Create a data frame for use in making predictions.

Description

Constructs a grid of values spanning the ranges of the spline covariates stored in an LMMsolver object.

Usage

makeGrid(object, grid)

Value

A data frame containing all combinations of grid values for the spline covariates.

Arguments

object

An LMMsolver object.

grid

A numeric vector specifying the number of grid points for each spline dimension. Its length must equal the number of spline variables.

Details

For each spline variable, equally spaced values are generated between the minimum and maximum values of the B-splines. The Cartesian product of these sequences is returned using expand.grid.

Examples

Run this code
if (FALSE) {
## Create a 200 x 300 grid for a two-dimensional spline term
grd <- makeGrid(fit, grid = c(200, 300))

head(grd)
}

Run the code above in your browser using DataLab