new_x {lgpr}R Documentation

Create test input points for prediction

Description

Replaces a continuous variable x in the data frame, and possibly another continuous variable x_ns derived from it, with new values, for each level of a grouping factor (usually id)

Usage

new_x(data, x_values, group_by = "id", x = "age", x_ns = NULL)

Arguments

data

A data frame. Can also be an lgpfit or lgpmodel object, in which case data is extracted from it.

x_values

the values of x to set for each individual

group_by

name of the grouping variable, must be a factor in data (or use group_by=NA to create a dummy grouping factor which has only one value)

x

of the variable along which to extend, must be a numeric in data

x_ns

of a nonstationary variable derived from x, must be a numeric in data

Value

a data frame containing the following columns

See Also

Other data frame handling functions: add_dis_age(), add_factor_crossing(), add_factor(), adjusted_c_hat(), split()


[Package lgpr version 1.2.4 Index]