| residuals | R Documentation |
Compute residuals from fitted ForceChoice model objects. Supported types are raw (response), Pearson, and deviance residuals.
## S3 method for class 'MIRT'
residuals(object, type = c("raw", "pearson", "deviance"), ...)
## S3 method for class 'MGPCM'
residuals(object, type = c("raw", "pearson", "deviance"), ...)
## S3 method for class 'MGGUM'
residuals(object, type = c("raw", "pearson", "deviance"), ...)
## S3 method for class 'FCMIRT'
residuals(object, type = c("raw", "pearson", "deviance"), ...)
## S3 method for class 'FCDCM'
residuals(object, type = c("raw", "pearson", "deviance"), ...)
## S3 method for class 'FCGDINA'
residuals(object, type = c("raw", "pearson", "deviance"), ...)
## S3 method for class 'FCGGUM'
residuals(object, type = c("raw", "pearson", "deviance"), ...)
## S3 method for class 'TIRT'
residuals(object, type = c("raw", "pearson", "deviance"), ...)
object |
A fitted model object. |
type |
Character; |
... |
Additional arguments (currently ignored). |
Residual types follow standard GLM conventions for binary responses:
raw: e_{ij} = y_{ij} - \hat{p}_{ij}
Pearson:
r_{ij} = e_{ij} / \sqrt{\hat{p}_{ij}(1-\hat{p}_{ij})}
deviance:
d_{ij} = \mathrm{sign}(e_{ij}) \sqrt{2\left[y_{ij}\log\frac{y_{ij}}{\hat{p}_{ij}} + (1-y_{ij})\log\frac{1-y_{ij}}{1-\hat{p}_{ij}}\right]}
For polytomous and forced-choice models, residuals are computed on a category-indicator matrix. This treats ordered categories and nominal forced-choice response patterns as multinomial outcomes rather than as numeric scores.
A numeric matrix with the same dimensions as the corresponding
fitted output.
residuals(MIRT): Residuals for MIRT objects.
residuals(MGPCM): Residuals for MGPCM objects.
residuals(MGGUM): Residuals for MGGUM objects.
residuals(FCMIRT): Residuals for FCMIRT objects.
residuals(FCDCM): Residuals for FCDCM objects.
residuals(FCGDINA): Residuals for FCGDINA objects.
residuals(FCGGUM): Residuals for FCGGUM objects.
residuals(TIRT): Residuals for TIRT objects.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.