Extract the model frame from a fitted model object.

# S3 method for splm
model.frame(formula, ...)

# S3 method for spautor
model.frame(formula, ...)

# S3 method for spglm
model.frame(formula, ...)

# S3 method for spgautor
model.frame(formula, ...)

Arguments

formula

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

...

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

Value

A model frame that contains the variables used by the formula for the fitted model object.

Examples

spmod <- splm(z ~ water + tarp,
  data = caribou,
  spcov_type = "exponential", xcoord = x, ycoord = y
)
model.frame(spmod)
#>        z water  tarp
#> 1  2.421     Y clear
#> 2  2.443     Y shade
#> 3  1.810     Y  none
#> 4  1.966     N clear
#> 5  2.377     N shade
#> 6  2.224     Y  none
#> 7  2.101     N clear
#> 8  1.804     Y clear
#> 9  1.963     Y shade
#> 10 2.099     Y  none
#> 11 1.886     Y clear
#> 12 2.130     Y shade
#> 13 1.861     Y  none
#> 14 2.366     N shade
#> 15 1.994     N  none
#> 16 1.637     N clear
#> 17 2.447     N shade
#> 18 1.819     N  none
#> 19 2.045     Y shade
#> 20 1.841     Y  none
#> 21 2.115     N  none
#> 22 1.996     Y clear
#> 23 1.801     N clear
#> 24 2.049     N shade
#> 25 2.129     N  none
#> 26 2.023     N clear
#> 27 2.050     N shade
#> 28 2.029     N  none
#> 29 1.789     Y clear
#> 30 2.063     Y shade