Standard errors missing (NA) for spatial range and spatial standard deviations #113
Answered
by
seananderson
seananderson
asked this question in
Q&A
-
Question by email:
|
Beta Was this translation helpful? Give feedback.
Answered by
seananderson
Aug 23, 2022
Replies: 1 comment
-
We did that because the standard errors are more representative in log space for those and figured it would be confusing if the SEs didn't match the confidence intervals. You’ll see the confidence intervals if you set library(sdmTMB)
fit <- sdmTMB(
density ~ s(depth),
data = pcod_2011, mesh = pcod_mesh_2011,
family = tweedie(link = "log")
)
tidy(fit, "ran_pars", conf.int = TRUE)
#> term estimate std.error conf.low conf.high
#> 1 range 16.839875 NA 3.4026237 83.341979
#> 3 phi 13.677114 NA 12.4377763 15.039942
#> 4 sigma_O 2.201739 NA 0.7350579 6.594929
#> 5 tweedie_p 1.580860 NA 1.5505486 1.610573
se <- as.list(fit$sd_report, "Std. Error", report = TRUE)
est <- as.list(fit$sd_report, "Estimate", report = TRUE)
est$log_sigma_O
#> [1] 0.7892475
se$log_sigma_O
#> [1] 0.5597315
est$sigma_O
#> [1] 2.201739
se$sigma_O
#> [1] 1.232383
# a matrix since the ranges aren't always shared between spatial/spatiotemporal components:
est$log_range
#> [,1]
#> [1,] 2.82375
#> [2,] 2.82375
se$log_range
#> [,1]
#> [1,] 0.8159348
#> [2,] 0.8159348
exp(est$log_range[1,1] + c(qnorm(0.025), qnorm(0.975)) * se$log_range[1,1])
#> [1] 3.402624 83.341979
est$range
#> [,1]
#> [1,] 16.83988
#> [2,] 16.83988
se$range
#> [,1]
#> [1,] 13.74024
#> [2,] 13.74024 Created on 2022-08-23 with reprex v2.0.2 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
seananderson
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We did that because the standard errors are more representative in log space for those and figured it would be confusing if the SEs didn't match the confidence intervals. You’ll see the confidence intervals if you set
conf.int = TRUE
intidy()
, which uses the log space standard error. See?tidy.sdmTMB
. You can get them from the SD report if you want: