Skip to content

Can I get p-values out of a fitted sdmTMB object #128

Answered by seananderson
ericward-noaa asked this question in Q&A
Discussion options

You must be logged in to vote

Or more directly with TMB::summary.sdreport(), but without the nicely named coefficients (look at the b_j in order and they should match print() or tidy().

library(sdmTMB)
pcod$fyear <- as.factor(pcod$year)
mesh <- make_mesh(pcod, c("X", "Y"), cutoff = 20)
fit <- sdmTMB(
  density ~ fyear,
  data = pcod, mesh = mesh,
  family = tweedie(link = "log")
)
summary(fit$sd_report, select = "fixed", p.value = TRUE)
#>             Estimate Std. Error    z value   Pr(>|z^2|)
#> b_j       2.86631816 0.33468294  8.5642793 1.087539e-17
#> b_j       0.71727094 0.19587369  3.6619056 2.503461e-04
#> b_j       0.66425861 0.19211819  3.4575520 5.451071e-04
#> b_j      -0.66291876 0.21140993 -3.1357031 1.71…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ericward-noaa
Comment options

Answer selected by ericward-noaa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants