Learn R Programming

spmodel (version 0.8.0)

model.matrix.spmodel: Extract the model matrix from a fitted model object

Description

Extract the model matrix (X) from a fitted model object.

Usage

# S3 method for splm
model.matrix(object, ...)

# S3 method for spautor model.matrix(object, ...)

# S3 method for spglm model.matrix(object, ...)

# S3 method for spgautor model.matrix(object, ...)

Value

The model matrix (of the fixed effects), whose rows represent observations and whose columns represent explanatory variables corresponding to each fixed effect.

Arguments

object

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

...

Other arguments. Not used (needed for generic consistency).

See Also

Examples

Run this code
spmod <- splm(z ~ water + tarp,
  data = caribou,
  spcov_type = "exponential", xcoord = x, ycoord = y
)
model.matrix(spmod)

Run the code above in your browser using DataLab