Description Usage Arguments Details Author(s) Examples
This function assess the residual using given actual and predicted values.
1 |
act |
numerical vector for actual observation. |
pred |
numerical vector for model preidctions. It must have the same length as act. |
weight |
numerical vector to give weight to observations. |
exposure |
numerical vector to give exposure to observations. |
bucket |
Integer. It specifies the number of bucket of the AvsE plot. |
residualFun |
Character. Name of residual function. The first parameter must be actual, and second parameter must be predictions. By default, residual function is difference between 'act' and 'pred'. |
... |
other parameters for 'residualFun' specified. |
In previous version of this function, the residual in this function is defined as: Residual = actual - predicted. 'resi' or 'reisdual' function from 'stats' package are not used because this function will be used for much wider model assess (e.g. 'randomFoest', 'gbm'), and 2 functions mentioned above can only applied to 'glm' and 'lm'.
This function will give 2 plots: AvsE plot: The average actual and predicted value for each bucket, with a diagnal line for comparison. Residual vs Prediction: This plot is used to assess the baise and heterogeneity
Sixiang Hu
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.