Skip to contents

Append the fitted() and deviance residuals() values to the input data.

Usage

# S3 method for class 'kb_fit'
augment(x, ...)

Arguments

x

A kb_fit object.

...

These dots are for future extensions and must be empty.

Value

The input data with added columns fitted (the posterior median of the expected response) and residual (the posterior median of the deviance residual).

Examples

augment(fit_weight_sim_nereo)
#> # A tibble: 660 × 6
#>    diameter_mm weight_kg site       year  fitted residual
#>          <dbl>     <dbl> <fct>      <fct>  <dbl>    <dbl>
#>  1        28.6     0.663 otter_cove 2020   0.779  -0.117 
#>  2        16.5     0.569 otter_cove 2020   0.262   1.91  
#>  3        27.3     0.841 otter_cove 2020   0.697   0.640 
#>  4        38.3     1.38  otter_cove 2020   1.64   -0.154 
#>  5        16.2     0.153 otter_cove 2020   0.255  -0.877 
#>  6        29.8     0.793 otter_cove 2020   0.861   0.0529
#>  7        34.7     1.36  otter_cove 2020   1.27    0.389 
#>  8        16.2     0.141 otter_cove 2020   0.255  -1.05  
#>  9        25.9     0.311 otter_cove 2020   0.615  -1.25  
#> 10        35.5     1.53  otter_cove 2020   1.34    0.508 
#> # ℹ 650 more rows