coef extracts fitted model coefficients from splm() or spautor()
fitted model objects. coefficients is an alias for it.
Usage
# S3 method for spmod
coef(object, type = "fixed", ...)
# S3 method for spmod
coefficients(object, type = "fixed", ...)Arguments
- object
- type
"fixed"for fixed effect coefficients,"spcov"for spatial covariance parameter coefficients, or"randcov"for random effect variance coefficients. Defaults to"fixed". Iftype = "spcov", the coefficient vector is anspcov_params()object (which means that has class matching the spatial covariance function used).- ...
Other arguments. Not used (needed for generic consistency).
Examples
spmod <- splm(z ~ water + tarp,
data = caribou,
spcov_type = "exponential", xcoord = x, ycoord = y
)
coef(spmod)
#> (Intercept) waterY tarpnone tarpshade
#> 2.04980603 -0.08309674 0.08005229 0.28654133
coefficients(spmod)
#> (Intercept) waterY tarpnone tarpshade
#> 2.04980603 -0.08309674 0.08005229 0.28654133
coef(spmod, type = "spcov")
#> de ie range rotate scale
#> 0.11086032 0.02259843 19.11677659 0.00000000 1.00000000
#> attr(,"class")
#> [1] "exponential"