coef extracts fitted model coefficients from
fitted model objects. coefficients is an alias for it.
# S3 method for class 'splm'
coef(object, type = "fixed", ...)
# S3 method for class 'splm'
coefficients(object, type = "fixed", ...)
# S3 method for class 'spautor'
coef(object, type = "fixed", ...)
# S3 method for class 'spautor'
coefficients(object, type = "fixed", ...)
# S3 method for class 'spglm'
coef(object, type = "fixed", ...)
# S3 method for class 'spglm'
coefficients(object, type = "fixed", ...)
# S3 method for class 'spgautor'
coef(object, type = "fixed", ...)
# S3 method for class 'spgautor'
coefficients(object, type = "fixed", ...)A fitted model object from splm(), spautor(), spglm(), or spgautor().
"fixed" for fixed effect coefficients, "spcov" for
spatial covariance parameter coefficients, or "randcov" for random effect
variance coefficients. Defaults to "fixed". If type = "spcov", the
coefficient vector is an spcov_params() object (which means that has class
matching the spatial covariance function used).
Other arguments. Not used (needed for generic consistency).
A named vector of coefficients.
spmod <- splm(z ~ water + tarp,
data = caribou,
spcov_type = "exponential", xcoord = x, ycoord = y
)
coef(spmod)
#> (Intercept) waterY tarpnone tarpshade
#> 2.05021026 -0.08336215 0.08006146 0.28663447
coefficients(spmod)
#> (Intercept) waterY tarpnone tarpshade
#> 2.05021026 -0.08336215 0.08006146 0.28663447
coef(spmod, type = "spcov")
#> de ie range rotate scale
#> 0.10672409 0.02243934 18.01186246 0.00000000 1.00000000
#> attr(,"class")
#> [1] "exponential"