augment.graph_lme {MetricGraph} | R Documentation |
Augment data with information from a graph_lme
object
Description
Augment accepts a model object and a dataset and adds information about each observation in the dataset. It includes
predicted values in the .fitted
column, residuals in the .resid
column, and standard errors for the fitted values in a .se.fit
column.
It also contains the New columns always begin with a . prefix to avoid overwriting columns in the original dataset.
Usage
## S3 method for class 'graph_lme'
augment(
x,
newdata = NULL,
which_repl = NULL,
sd_post_re = FALSE,
se_fit = FALSE,
conf_int = FALSE,
pred_int = FALSE,
level = 0.95,
edge_number = "edge_number",
distance_on_edge = "distance_on_edge",
coord_x = "coord_x",
coord_y = "coord_y",
data_coords = c("PtE", "spatial"),
normalized = FALSE,
no_nugget = FALSE,
check_euclidean = FALSE,
...
)
Arguments
x |
A |
newdata |
A |
which_repl |
Which replicates to obtain the prediction. If |
sd_post_re |
Logical indicating whether or not a .sd_post_re column should be added to the augmented output containing the posterior standard deviations of the random effects. |
se_fit |
Logical indicating whether or not a .se_fit column should be added to the augmented output containing the standard errors of the fitted values. If |
conf_int |
Logical indicating whether or not confidence intervals for the posterior mean of the random effects should be built. |
pred_int |
Logical indicating whether or not prediction intervals for the fitted values should be built. If |
level |
Level of confidence and prediction intervals if they are constructed. |
edge_number |
Name of the variable that contains the edge number, the
default is |
distance_on_edge |
Name of the variable that contains the distance on
edge, the default is |
coord_x |
Column (or entry on the list) of the |
coord_y |
Column (or entry on the list) of the |
data_coords |
To be used only if |
normalized |
Are the distances on edges normalized? |
no_nugget |
Should the prediction be done without nugget? |
check_euclidean |
Check if the graph used to compute the resistance distance has Euclidean edges? The graph used to compute the resistance distance has the observation locations as vertices. |
... |
Additional arguments. |
Value
A tidyr::tibble()
with columns:
-
.fitted
Fitted or predicted value. -
.relwrconf
Lower bound of the confidence interval of the random effects, if conf_int = TRUE -
.reuprconf
Upper bound of the confidence interval of the random effects, if conf_int = TRUE -
.fittedlwrpred
Lower bound of the prediction interval, if conf_int = TRUE -
.fitteduprpred
Upper bound of the prediction interval, if conf_int = TRUE -
.fixed
Prediction of the fixed effects. -
.random
Prediction of the random effects. -
.resid
The ordinary residuals, that is, the difference between observed and fitted values. -
.std_resid
The standardized residuals, that is, the ordinary residuals divided by the standard error of the fitted values (by the prediction standard error), if se_fit = TRUE or pred_int = TRUE. -
.se_fit
Standard errors of fitted values, if se_fit = TRUE. -
.sd_post_re
Standard deviation of the posterior mean of the random effects, if se_fit = TRUE.