pseudoR2 {spmodel} | R Documentation |
Compute a pseudo r-squared
Description
Compute a pseudo r-squared for a fitted model object.
Usage
pseudoR2(object, ...)
## S3 method for class 'splm'
pseudoR2(object, adjust = FALSE, ...)
## S3 method for class 'spautor'
pseudoR2(object, adjust = FALSE, ...)
## S3 method for class 'spglm'
pseudoR2(object, adjust = FALSE, ...)
## S3 method for class 'spgautor'
pseudoR2(object, adjust = FALSE, ...)
Arguments
object |
A fitted model object from |
... |
Other arguments. Not used (needed for generic consistency). |
adjust |
A logical indicating whether the pseudo r-squared
should be adjusted to account for the number of explanatory variables. The
default is |
Details
Several pseudo r-squared statistics exist for in the literature. We define this pseudo r-squared as one minus the ratio of the deviance of a full model relative to the deviance of a null (intercept only) model. This pseudo r-squared can be viewed as a generalization of the classical r-squared definition seen as one minus the ratio of error sums of squares from the full model relative to the error sums of squares from the null model. If adjusted, the adjustment is analogous to the the classical r-squared adjustment.
Value
The pseudo r-squared as a numeric vector.
Examples
spmod <- splm(z ~ water + tarp,
data = caribou,
spcov_type = "exponential", xcoord = x, ycoord = y
)
pseudoR2(spmod)