Predicted values and intervals based on a fitted model object.
# S3 method for splm
predict(
object,
newdata,
se.fit = FALSE,
scale = NULL,
df = Inf,
interval = c("none", "confidence", "prediction"),
level = 0.95,
type = c("response", "terms"),
block = FALSE,
local,
terms = NULL,
na.action = na.fail,
...
)
# S3 method for spautor
predict(
object,
newdata,
se.fit = FALSE,
scale = NULL,
df = Inf,
interval = c("none", "confidence", "prediction"),
level = 0.95,
type = c("response", "terms"),
local,
terms = NULL,
na.action = na.fail,
...
)
# S3 method for splm_list
predict(
object,
newdata,
se.fit = FALSE,
scale = NULL,
df = Inf,
interval = c("none", "confidence", "prediction"),
level = 0.95,
type = c("response", "terms"),
local,
terms = NULL,
na.action = na.fail,
...
)
# S3 method for spautor_list
predict(
object,
newdata,
se.fit = FALSE,
scale = NULL,
df = Inf,
interval = c("none", "confidence", "prediction"),
level = 0.95,
type = c("response", "terms"),
local,
terms = NULL,
na.action = na.fail,
...
)
# S3 method for splmRF
predict(object, newdata, local, ...)
# S3 method for spautorRF
predict(object, newdata, local, ...)
# S3 method for splmRF_list
predict(object, newdata, local, ...)
# S3 method for spautorRF_list
predict(object, newdata, local, ...)
# S3 method for spglm
predict(
object,
newdata,
type = c("link", "response", "terms"),
se.fit = FALSE,
interval = c("none", "confidence", "prediction"),
level = 0.95,
dispersion = NULL,
terms = NULL,
local,
var_correct = TRUE,
newdata_size,
na.action = na.fail,
...
)
# S3 method for spgautor
predict(
object,
newdata,
type = c("link", "response", "terms"),
se.fit = FALSE,
interval = c("none", "confidence", "prediction"),
level = 0.95,
dispersion = NULL,
terms = NULL,
local,
var_correct = TRUE,
newdata_size,
na.action = na.fail,
...
)
# S3 method for spglm_list
predict(
object,
newdata,
type = c("link", "response", "terms"),
se.fit = FALSE,
interval = c("none", "confidence", "prediction"),
level = 0.95,
dispersion = NULL,
terms = NULL,
local,
var_correct = TRUE,
newdata_size,
na.action = na.fail,
...
)
# S3 method for spgautor_list
predict(
object,
newdata,
type = c("link", "response", "terms"),
se.fit = FALSE,
interval = c("none", "confidence", "prediction"),
level = 0.95,
dispersion = NULL,
terms = NULL,
local,
var_correct = TRUE,
newdata_size,
na.action = na.fail,
...
)A fitted model object.
A data frame or sf object in which to
look for variables with which to predict. If a data frame, newdata
must contain all variables used by formula(object) and all variables
representing coordinates. If an sf object, newdata must contain
all variables used by formula(object) and coordinates are obtained
from the geometry of newdata. If omitted, missing data from the
fitted model object are used.
A logical indicating if standard errors are returned.
The default is FALSE.
A numeric constant by which to scale the regular standard errors and intervals.
Similar to but slightly different than scale for stats::predict.lm(), because
predictions form a spatial model may have different residual variances for each
observation in newdata. The default is NULL, which returns
the regular standard errors and intervals.
Degrees of freedom to use for confidence or prediction intervals
(ignored if scale is not specified). The default is Inf.
Type of interval calculation. The default is "none".
Other options are "confidence" (for confidence intervals) and
"prediction" (for prediction intervals). When interval
is "none" or "prediction", predictions are returned (and when
requested, their corresponding uncertainties). When interval
is "confidence", mean estimates are returned (and when
requested, their corresponding uncertainties). This "none" behavior
differs from that of lm(), as lm() returns confidence
uncertainties (in .$se.fit).
Tolerance/confidence level. The default is 0.95.
The prediction type, either on the response scale, link scale (only for
spglm() or spgautor() model objects), or terms scale.
A logical indicating whether a block prediction over the entire region
in newdata should be returned. When block is TRUE,
newdata should be a dense grid of prediction locations that span
the entire region. The default is FALSE, which
returns point predictions for each location on newdata.
A optional logical or list controlling the big data approximation. If omitted, local
is set to TRUE or FALSE based on the observed data sample size (i.e., sample size of the fitted
model object) -- if the sample size exceeds 10,000, local is
set to TRUE, otherwise it is set to FALSE. This default behavior
occurs because main computational
burden of the big data approximation depends almost exclusively on the
observed data sample size, not the number of predictions desired
(which we feel is not intuitive at first glance).
If local is FALSE, no big data approximation
is implemented. If a list is provided, the following arguments detail the big
data approximation:
method: The big data approximation method. If method = "all",
all observations are used and size is ignored. If method = "distance",
the size data observations closest (in terms of Euclidean distance)
to the observation requiring prediction are used.
If method = "covariance", the size data observations
with the highest covariance with the observation requiring prediction are used.
If random effects and partition factors are not used in estimation and
the spatial covariance function is monotone decreasing,
"distance" and "covariance" are equivalent. The default
is "covariance". Only used with models fit using splm() or spglm().
size: The number of data observations to use when method
is "distance" or "covariance". The default is 100. Only used
with models fit using splm() or spglm().
parallel: If TRUE, parallel processing via the
parallel package is automatically used. This can significantly speed
up computations even when method = "all" (i.e., no big data
approximation is used), as predictions
are spread out over multiple cores. The default is FALSE.
ncores: If parallel = TRUE, the number of cores to
parallelize over. The default is the number of available cores on your machine.
When local is a list, at least one list element must be provided to
initialize default arguments for the other list elements.
If local is TRUE, defaults for local are chosen such
that local is transformed into
list(size = 100, method = "covariance", parallel = FALSE).
If block is TRUE, local accepts method and size,
and method takes values of "all", "covariance",
and "distance", similar as when block is FALSE.
The default method is "covariance" with size 4000. This default size is
much larger than when block is FALSE. This is because when block is TRUE,
covariances and explanatory variables are averaged before prediction, which greatly
reduces computational burden, only requiring the Cholesky decomposition
of one observed covariance matrix. Because the computational burden is reduced dramatically when block is TRUE,
parallel processing is not needed and hence, parallel and ncores are ignored if specified in local.
If type is "terms", the type of terms to be returned,
specified via either numeric position or name. The default is all terms are included.
Missing (NA) values in newdata will return an error and should
be removed before proceeding.
Other arguments. Only used for models fit using splmRF()
or spautorRF() where ... indicates other
arguments to ranger::predict.ranger().
The dispersion of assumed when computing the prediction standard errors
for spglm() or spgautor() model objects when family
is "nbinomial", "beta", "Gamma", or "inverse.gaussian".
If omitted, the model object dispersion parameter is used.
A logical indicating whether to return the corrected prediction
variances when predicting via models fit using spglm() or spgautor(). The default is
TRUE.
The size value for each observation in newdata
used when predicting for the binomial family.
For splm or spautor objects, if se.fit is FALSE, predict() returns
a vector of predictions or a matrix of predictions with column names
fit, lwr, and upr if interval is "confidence"
or "prediction". If se.fit is TRUE, a list with the following components is returned:
fit: vector or matrix as above
se.fit: standard error of each fit
For splm_list or spautor_list objects, a list that contains relevant quantities for each
list element.
For splmRF or spautorRF objects, a vector of predictions. For splmRF_list
or spautorRF_list objects, a list that contains relevant quantities for each list element.
For splm and spautor objects, the (empirical) best linear unbiased predictions (i.e., Kriging
predictions) at each site are returned when interval is "none"
or "prediction" alongside standard errors. Prediction intervals
are also returned if interval is "prediction". When
interval is "confidence", the estimated mean is returned
alongside standard errors and confidence intervals for the mean. For splm_list
and spautor_list objects, predictions and associated intervals and standard errors are returned
for each list element.
For splmRF or spautorRF objects, random forest spatial residual
model predictions are computed by combining the random forest prediction with
the (empirical) best linear unbiased prediction for the residual. Fox et al. (2020)
call this approach random forest regression Kriging. For splmRF_list
or spautorRF objects,
predictions are returned for each list element.
Fox, E.W., Ver Hoef, J. M., & Olsen, A. R. (2020). Comparing spatial regression to random forests for large environmental data sets. PloS one, 15(3), e0229509.
spmod <- splm(sulfate ~ 1,
data = sulfate,
spcov_type = "exponential", xcoord = x, ycoord = y
)
#> Warning: data is an sf object. Ignoring xcoord and ycoord arguments.
predict(spmod, sulfate_preds)
#> 1 2 3 4 5 6 7 8
#> 1.624009 24.395319 8.947418 16.446500 4.948606 26.762345 2.868187 14.255728
#> 9 10 11 12 13 14 15 16
#> 1.528476 14.300872 1.209497 17.122842 1.327888 20.181497 21.283600 11.235139
#> 17 18 19 20 21 22 23 24
#> 18.686876 9.668878 1.790990 23.619017 3.289241 2.346246 2.047833 2.006561
#> 25 26 27 28 29 30 31 32
#> 3.201769 1.495122 18.651578 7.835887 18.798495 5.149106 1.815728 4.066504
#> 33 34 35 36 37 38 39 40
#> 12.410924 3.148776 1.300986 6.967949 18.968441 7.314436 14.658665 15.508052
#> 41 42 43 44 45 46 47 48
#> 12.397846 24.894481 17.323940 26.836397 1.606072 8.556330 3.772526 14.958904
#> 49 50 51 52 53 54 55 56
#> 24.459497 1.970591 27.142423 13.601790 2.573685 1.910667 7.462880 17.171611
#> 57 58 59 60 61 62 63 64
#> 16.968042 1.342515 18.665014 12.684033 15.403922 23.536085 1.593403 16.992112
#> 65 66 67 68 69 70 71 72
#> 28.490473 1.299507 1.156972 6.169330 3.440658 10.783522 3.607576 17.824632
#> 73 74 75 76 77 78 79 80
#> 8.929036 7.283987 2.139187 1.661652 19.376280 1.298919 16.340008 15.290979
#> 81 82 83 84 85 86 87 88
#> 17.808855 3.667224 9.735831 1.840372 1.672515 7.801513 2.325218 1.613402
#> 89 90 91 92 93 94 95 96
#> 2.692172 19.410507 4.064770 7.960096 12.411138 25.909052 15.122960 16.655562
#> 97 98 99 100
#> 21.647230 20.829858 16.763191 16.680239
predict(spmod, sulfate_preds, interval = "prediction")
#> fit lwr upr
#> 1 1.624009 -6.4466253 9.694643
#> 2 24.395319 16.8500433 31.940594
#> 3 8.947418 1.0157736 16.879063
#> 4 16.446500 8.6266270 24.266372
#> 5 4.948606 -2.7766202 12.673832
#> 6 26.762345 19.2316689 34.293021
#> 7 2.868187 -5.0737681 10.810141
#> 8 14.255728 6.7472875 21.764168
#> 9 1.528476 -6.3392618 9.396215
#> 10 14.300872 6.6182651 21.983479
#> 11 1.209497 -6.7439161 9.162910
#> 12 17.122842 9.5860947 24.659589
#> 13 1.327888 -6.8424375 9.498214
#> 14 20.181497 12.7470639 27.615931
#> 15 21.283600 13.5900268 28.977173
#> 16 11.235139 3.2217759 19.248503
#> 17 18.686876 11.0819760 26.291776
#> 18 9.668878 1.7791074 17.558648
#> 19 1.790990 -6.1939399 9.775920
#> 20 23.619017 16.0402123 31.197822
#> 21 3.289241 -4.7270635 11.305545
#> 22 2.346246 -5.1441640 9.836655
#> 23 2.047833 -6.0421934 10.137859
#> 24 2.006561 -5.7808121 9.793935
#> 25 3.201769 -4.5420731 10.945611
#> 26 1.495122 -6.3572432 9.347486
#> 27 18.651578 11.1199184 26.183237
#> 28 7.835887 -0.3427818 16.014556
#> 29 18.798495 11.0246933 26.572298
#> 30 5.149106 -2.6926600 12.990872
#> 31 1.815728 -6.3378244 9.969280
#> 32 4.066504 -3.5882335 11.721242
#> 33 12.410924 4.6427937 20.179054
#> 34 3.148776 -4.4689556 10.766508
#> 35 1.300986 -6.8455656 9.447538
#> 36 6.967949 -0.9703506 14.906249
#> 37 18.968441 11.6361006 26.300782
#> 38 7.314436 -0.5212963 15.150168
#> 39 14.658665 6.7407623 22.576568
#> 40 15.508052 7.7668705 23.249234
#> 41 12.397846 4.4118062 20.383886
#> 42 24.894481 17.5367811 32.252180
#> 43 17.323940 9.6371219 25.010759
#> 44 26.836397 19.3745867 34.298208
#> 45 1.606072 -6.2119772 9.424122
#> 46 8.556330 0.4323397 16.680319
#> 47 3.772526 -3.6895226 11.234576
#> 48 14.958904 7.1674434 22.750364
#> 49 24.459497 16.8185776 32.100416
#> 50 1.970591 -6.0096614 9.950844
#> 51 27.142423 19.7265315 34.558314
#> 52 13.601790 6.0634533 21.140126
#> 53 2.573685 -5.1273026 10.274673
#> 54 1.910667 -6.3019052 10.123239
#> 55 7.462880 -0.4178286 15.343588
#> 56 17.171611 9.5011471 24.842075
#> 57 16.968042 9.1588390 24.777245
#> 58 1.342515 -6.4518144 9.136845
#> 59 18.665014 11.2593609 26.070668
#> 60 12.684033 4.7569074 20.611159
#> 61 15.403922 7.8559236 22.951920
#> 62 23.536085 16.0346775 31.037492
#> 63 1.593403 -6.2027601 9.389565
#> 64 16.992112 9.1653935 24.818831
#> 65 28.490473 20.9640417 36.016904
#> 66 1.299507 -6.8044341 9.403448
#> 67 1.156972 -6.9385809 9.252526
#> 68 6.169330 -1.7859469 14.124606
#> 69 3.440658 -4.6319002 11.513217
#> 70 10.783522 3.0358671 18.531178
#> 71 3.607576 -4.3529720 11.568125
#> 72 17.824632 10.4664428 25.182822
#> 73 8.929036 1.3721396 16.485933
#> 74 7.283987 -0.7459909 15.313965
#> 75 2.139187 -6.0790935 10.357467
#> 76 1.661652 -5.8870518 9.210357
#> 77 19.376280 11.6670193 27.085540
#> 78 1.298919 -6.5548708 9.152709
#> 79 16.340008 8.5776678 24.102348
#> 80 15.290979 7.3458497 23.236108
#> 81 17.808855 10.2202055 25.397504
#> 82 3.667224 -3.8337247 11.168173
#> 83 9.735831 1.9310480 17.540614
#> 84 1.840372 -5.9619665 9.642711
#> 85 1.672515 -6.0432434 9.388274
#> 86 7.801513 -0.3445465 15.947572
#> 87 2.325218 -5.6195151 10.269951
#> 88 1.613402 -6.0328549 9.259658
#> 89 2.692172 -4.9800331 10.364376
#> 90 19.410507 12.0255970 26.795417
#> 91 4.064770 -4.0069423 12.136483
#> 92 7.960096 0.1240763 15.796116
#> 93 12.411138 4.4675947 20.354681
#> 94 25.909052 18.3932818 33.424822
#> 95 15.122960 7.2165536 23.029367
#> 96 16.655562 9.0500159 24.261109
#> 97 21.647230 13.9120066 29.382453
#> 98 20.829858 13.5080438 28.151672
#> 99 16.763191 9.3107299 24.215653
#> 100 16.680239 8.6515429 24.708936
augment(spmod, newdata = sulfate_preds, interval = "prediction")
#> Simple feature collection with 100 features and 3 fields
#> Geometry type: POINT
#> Dimension: XY
#> Bounding box: xmin: -2283774 ymin: 582930.5 xmax: 1985906 ymax: 3037173
#> Projected CRS: NAD83 / Conus Albers
#> # A tibble: 100 × 4
#> .fitted .lower .upper geometry
#> * <dbl> <dbl> <dbl> <POINT [m]>
#> 1 1.62 -6.45 9.69 (-1771413 1752976)
#> 2 24.4 16.9 31.9 (1018112 1867127)
#> 3 8.95 1.02 16.9 (-291256.8 1553212)
#> 4 16.4 8.63 24.3 (1274293 1267835)
#> 5 4.95 -2.78 12.7 (-547437.6 1638825)
#> 6 26.8 19.2 34.3 (1445080 1981278)
#> 7 2.87 -5.07 10.8 (-1629090 3037173)
#> 8 14.3 6.75 21.8 (1302757 1039534)
#> 9 1.53 -6.34 9.40 (-1429838 2523494)
#> 10 14.3 6.62 22.0 (1131970 1096609)
#> # ℹ 90 more rows
# \donttest{
sulfate$var <- rnorm(NROW(sulfate)) # add noise variable
sulfate_preds$var <- rnorm(NROW(sulfate_preds)) # add noise variable
sprfmod <- splmRF(sulfate ~ var, data = sulfate, spcov_type = "exponential")
predict(sprfmod, sulfate_preds)
#> 1 2 3 4 5 6 7
#> -2.3942341 21.8386086 12.8325428 10.4501745 20.1163399 33.8068161 9.9766836
#> 8 9 10 11 12 13 14
#> 22.6019190 -1.7379813 22.3752912 7.2721764 28.4437612 9.5583689 21.3536968
#> 15 16 17 18 19 20 21
#> 12.1220298 5.8665227 9.7293567 5.9882528 6.2469942 22.4605542 3.8291129
#> 22 23 24 25 26 27 28
#> 8.5456900 -1.7892627 -4.7773800 12.7445409 -2.8522440 29.2562637 7.5503766
#> 29 30 31 32 33 34 35
#> 9.6203679 -3.2771804 -5.4435011 -2.1342662 10.8434099 3.1314979 7.7238229
#> 36 37 38 39 40 41 42
#> -4.9932134 14.5814082 3.0555131 20.2145806 5.7566767 5.4848077 25.6098649
#> 43 44 45 46 47 48 49
#> 9.4099319 19.7720360 2.2231972 2.6252595 3.5561073 14.8234391 38.5791327
#> 50 51 52 53 54 55 56
#> 7.0254164 36.6156637 6.9470123 8.3661828 -4.9111583 4.9969425 20.9944752
#> 57 58 59 60 61 62 63
#> 20.8304463 9.0695228 9.2441484 18.3499526 7.7627845 14.7168291 5.3697653
#> 64 65 66 67 68 69 70
#> 12.3660938 33.5060001 4.4336806 0.1216929 0.6980553 16.3762330 2.9011119
#> 71 72 73 74 75 76 77
#> 2.0177889 21.5956242 8.6695099 4.5018178 12.1043199 8.5538542 18.2405435
#> 78 79 80 81 82 83 84
#> 4.7974489 7.9102063 2.4733057 13.4487251 2.2237319 8.6397676 12.7058380
#> 85 86 87 88 89 90 91
#> -4.9359621 2.2713970 7.7014099 -3.5275117 -3.3445688 15.3067497 3.4381469
#> 92 93 94 95 96 97 98
#> 14.3167456 16.1252702 22.7823790 13.5592171 10.6967705 13.0762881 11.9534899
#> 99 100
#> 15.2108277 17.7514813
# }
# \donttest{
spgmod <- spglm(presence ~ elev * strat,
family = "binomial",
data = moose,
spcov_type = "exponential"
)
predict(spgmod, moose_preds)
#> 1 2 3 4 5 6
#> 0.090323080 -0.552960093 -2.263554802 -1.098562352 1.427164687 -3.017967563
#> 7 8 9 10 11 12
#> -3.378343360 -2.989825063 -1.033620274 -1.441968112 -0.002314762 1.959397916
#> 13 14 15 16 17 18
#> -0.308085881 -1.057872804 -0.557799825 -1.989177567 -1.249950216 -1.661631795
#> 19 20 21 22 23 24
#> -2.000709550 -1.456625541 -0.582727163 -1.687239087 -0.977090590 -0.642088369
#> 25 26 27 28 29 30
#> -0.839495518 -1.395255140 1.999524998 -3.397978145 0.189003651 -1.201831878
#> 31 32 33 34 35 36
#> 0.536783958 -2.138634396 -0.644580166 -1.361692092 -0.144114708 -1.467851126
#> 37 38 39 40 41 42
#> -0.346800922 -2.317198801 -1.280924322 -3.442672662 0.302866472 -3.463598244
#> 43 44 45 46 47 48
#> -1.801140509 -0.371938944 -3.343901550 -1.046988030 -1.439301045 -2.803217332
#> 49 50 51 52 53 54
#> -1.220321946 -1.303624872 -1.730942375 -1.097135426 1.479748809 -2.826025730
#> 55 56 57 58 59 60
#> -1.047065327 -1.115370554 -3.047487968 -1.316754680 -4.100116412 -0.550835841
#> 61 62 63 64 65 66
#> -1.200178935 -1.578204264 -0.754737616 0.503179666 -1.517542106 -2.955712683
#> 67 68 69 70 71 72
#> -1.634262908 0.835560993 -2.691593834 -1.412878667 -2.705366453 -1.755138400
#> 73 74 75 76 77 78
#> -0.578758438 -1.268122668 -3.250381458 -1.845400838 -2.912304526 -1.815351320
#> 79 80 81 82 83 84
#> -0.848378787 0.350555212 -2.216871794 -0.367789223 -3.035114500 -2.634776081
#> 85 86 87 88 89 90
#> -1.330907762 -0.725748040 -2.756902792 -3.111945678 -1.519457507 -4.202830087
#> 91 92 93 94 95 96
#> -1.689082635 -1.750628979 -0.218240096 -0.082030450 -0.358868745 0.885185571
#> 97 98 99 100
#> 0.493301699 -1.325530727 -0.845472209 -0.128197938
predict(spgmod, moose_preds, interval = "prediction")
#> fit lwr upr
#> 1 0.090323080 -2.2262092 2.40685538
#> 2 -0.552960093 -3.5653993 2.45947916
#> 3 -2.263554802 -5.0952538 0.56814424
#> 4 -1.098562352 -3.5603120 1.36318726
#> 5 1.427164687 -0.9340547 3.78838403
#> 6 -3.017967563 -5.9598711 -0.07606404
#> 7 -3.378343360 -6.2447610 -0.51192569
#> 8 -2.989825063 -5.7482940 -0.23135612
#> 9 -1.033620274 -4.2737192 2.20647867
#> 10 -1.441968112 -3.8607955 0.97685931
#> 11 -0.002314762 -2.3392798 2.33465023
#> 12 1.959397916 -0.9229430 4.84173879
#> 13 -0.308085881 -2.6940015 2.07782970
#> 14 -1.057872804 -3.4733525 1.35760688
#> 15 -0.557799825 -3.2598105 2.14421089
#> 16 -1.989177567 -4.2277780 0.24942289
#> 17 -1.249950216 -3.5741357 1.07423528
#> 18 -1.661631795 -5.1953601 1.87209648
#> 19 -2.000709550 -4.6063232 0.60490405
#> 20 -1.456625541 -4.1368089 1.22355786
#> 21 -0.582727163 -3.6249905 2.45953613
#> 22 -1.687239087 -4.0127891 0.63831096
#> 23 -0.977090590 -3.4059540 1.45177285
#> 24 -0.642088369 -3.1543883 1.87021153
#> 25 -0.839495518 -3.8079186 2.12892756
#> 26 -1.395255140 -4.5529447 1.76243446
#> 27 1.999524998 -0.3619220 4.36097201
#> 28 -3.397978145 -5.9515876 -0.84436866
#> 29 0.189003651 -2.5982095 2.97621685
#> 30 -1.201831878 -3.6353651 1.23170133
#> 31 0.536783958 -1.6840900 2.75765792
#> 32 -2.138634396 -5.0650432 0.78777445
#> 33 -0.644580166 -3.0879115 1.79875121
#> 34 -1.361692092 -3.9527964 1.22941223
#> 35 -0.144114708 -3.8590234 3.57079400
#> 36 -1.467851126 -3.8965137 0.96081143
#> 37 -0.346800922 -3.4228713 2.72926948
#> 38 -2.317198801 -4.7254264 0.09102884
#> 39 -1.280924322 -3.8519991 1.29015047
#> 40 -3.442672662 -6.3749594 -0.51038596
#> 41 0.302866472 -2.0435722 2.64930516
#> 42 -3.463598244 -6.0374511 -0.88974537
#> 43 -1.801140509 -4.9631384 1.36085741
#> 44 -0.371938944 -2.9326599 2.18878197
#> 45 -3.343901550 -6.2460004 -0.44180272
#> 46 -1.046988030 -3.4222686 1.32829253
#> 47 -1.439301045 -4.2202622 1.34166007
#> 48 -2.803217332 -6.6000756 0.99364096
#> 49 -1.220321946 -3.7646729 1.32402898
#> 50 -1.303624872 -4.1935145 1.58626477
#> 51 -1.730942375 -5.3834203 1.92153556
#> 52 -1.097135426 -3.5313296 1.33705872
#> 53 1.479748809 -1.8411687 4.80066627
#> 54 -2.826025730 -6.6455747 0.99352325
#> 55 -1.047065327 -3.3196849 1.22555421
#> 56 -1.115370554 -4.2846212 2.05388014
#> 57 -3.047487968 -6.1780085 0.08303251
#> 58 -1.316754680 -3.7829063 1.14939692
#> 59 -4.100116412 -7.8915946 -0.30863822
#> 60 -0.550835841 -3.0747203 1.97304862
#> 61 -1.200178935 -3.5268013 1.12644342
#> 62 -1.578204264 -5.8664074 2.70999884
#> 63 -0.754737616 -4.1504512 2.64097598
#> 64 0.503179666 -1.7533947 2.75975405
#> 65 -1.517542106 -4.2155317 1.18044746
#> 66 -2.955712683 -5.4802770 -0.43114832
#> 67 -1.634262908 -5.3593679 2.09084207
#> 68 0.835560993 -1.5701832 3.24130517
#> 69 -2.691593834 -5.2554399 -0.12774775
#> 70 -1.412878667 -3.9025455 1.07678821
#> 71 -2.705366453 -6.3984015 0.98766857
#> 72 -1.755138400 -4.3400025 0.82972574
#> 73 -0.578758438 -3.2112907 2.05377382
#> 74 -1.268122668 -4.7293789 2.19313354
#> 75 -3.250381458 -6.2723891 -0.22837383
#> 76 -1.845400838 -4.6752072 0.98440556
#> 77 -2.912304526 -5.7293910 -0.09521810
#> 78 -1.815351320 -4.6420355 1.01133286
#> 79 -0.848378787 -3.8689383 2.17218070
#> 80 0.350555212 -2.3201771 3.02128753
#> 81 -2.216871794 -4.9998521 0.56610854
#> 82 -0.367789223 -2.8205731 2.08499467
#> 83 -3.035114500 -6.1967506 0.12652157
#> 84 -2.634776081 -5.2997272 0.03017506
#> 85 -1.330907762 -3.9230159 1.26120037
#> 86 -0.725748040 -3.4898935 2.03839743
#> 87 -2.756902792 -6.2361730 0.72236740
#> 88 -3.111945678 -5.7463400 -0.47755140
#> 89 -1.519457507 -4.2357234 1.19680840
#> 90 -4.202830087 -8.3746831 -0.03097711
#> 91 -1.689082635 -5.6263419 2.24817663
#> 92 -1.750628979 -4.5799565 1.07869857
#> 93 -0.218240096 -2.7910629 2.35458267
#> 94 -0.082030450 -4.0386692 3.87460832
#> 95 -0.358868745 -3.4760378 2.75830030
#> 96 0.885185571 -1.6124296 3.38280075
#> 97 0.493301699 -2.1127767 3.09938011
#> 98 -1.325530727 -3.9738166 1.32275517
#> 99 -0.845472209 -3.1309475 1.44000313
#> 100 -0.128197938 -2.5873097 2.33091383
augment(spgmod, newdata = moose_preds, interval = "prediction")
#> Simple feature collection with 100 features and 5 fields
#> Geometry type: POINT
#> Dimension: XY
#> Bounding box: xmin: 269386.2 ymin: 1418453 xmax: 419976.2 ymax: 1541763
#> Projected CRS: NAD83 / Alaska Albers
#> # A tibble: 100 × 6
#> elev strat .fitted .lower .upper geometry
#> * <dbl> <chr> <dbl> <dbl> <dbl> <POINT [m]>
#> 1 143. L 0.0903 -2.23 2.41 (401239.6 1436192)
#> 2 324. L -0.553 -3.57 2.46 (352640.6 1490695)
#> 3 158. L -2.26 -5.10 0.568 (360954.9 1491590)
#> 4 221. M -1.10 -3.56 1.36 (291839.8 1466091)
#> 5 209. M 1.43 -0.934 3.79 (310991.9 1441630)
#> 6 218. L -3.02 -5.96 -0.0761 (304473.8 1512103)
#> 7 127. L -3.38 -6.24 -0.512 (339011.1 1459318)
#> 8 122. L -2.99 -5.75 -0.231 (342827.3 1463452)
#> 9 191 L -1.03 -4.27 2.21 (284453.8 1502837)
#> 10 105. L -1.44 -3.86 0.977 (391343.9 1483791)
#> # ℹ 90 more rows
# }