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 |
group_by |
name of the grouping variable, must be a factor
in |
x |
of the variable along which to extend,
must be a numeric in |
x_ns |
of a nonstationary variable derived from |
Value
a data frame containing the following columns
all factors in the original
data
-
x
-
x_ns
(unless it is NULL)
See Also
Other data frame handling functions:
add_dis_age()
,
add_factor_crossing()
,
add_factor()
,
adjusted_c_hat()
,
split()