Learn R Programming

spmodel (version 0.10.0)

coef.spmodel: Extract fitted model coefficients

Description

coef extracts fitted model coefficients from fitted model objects. coefficients is an alias for it.

Usage

# S3 method for splm
coef(object, type = "fixed", ...)

# S3 method for splm coefficients(object, type = "fixed", ...)

# S3 method for spautor coef(object, type = "fixed", ...)

# S3 method for spautor coefficients(object, type = "fixed", ...)

# S3 method for spglm coef(object, type = "fixed", ...)

# S3 method for spglm coefficients(object, type = "fixed", ...)

# S3 method for spgautor coef(object, type = "fixed", ...)

# S3 method for spgautor coefficients(object, type = "fixed", ...)

Value

A named vector of coefficients.

Arguments

object

A fitted model object from splm(), spautor(), spglm(), or spgautor().

type

"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).

Examples

Run this code
spmod <- splm(z ~ water + tarp,
  data = caribou,
  spcov_type = "exponential", xcoord = x, ycoord = y
)
coef(spmod)
coefficients(spmod)
coef(spmod, type = "spcov")

Run the code above in your browser using DataLab