deviance | R Documentation |

Returns the deviance from a fit smoothing spline (fit by `ss`

), smooth model (fit by `sm`

), or generalized smooth model (fit by `gsm`

).

## S3 method for class 'gsm' deviance(object, ...) ## S3 method for class 'sm' deviance(object, ...) ## S3 method for class 'ss' deviance(object, ...)

`object` |
an object of class "gsm" output by the |

`...` |
other arugments (currently ignored) |

For `ss`

and `sm`

objects, the deviance is caculated assuming iid Gaussian errors.

For `gsm`

objects, the deviance is calculated by summing the squared deviance residuals, which are calculated using `family(object)$dev.resid`

Deviance of the model `object`

.

Nathaniel E. Helwig <helwig@umn.edu>

Chambers, J. M. and Hastie, T. J. (1992) *Statistical Models in S*. Wadsworth & Brooks/Cole.

Helwig, N. E. (2020). Multiple and Generalized Nonparametric Regression. In P. Atkinson, S. Delamont, A. Cernat, J. W. Sakshaug, & R. A. Williams (Eds.), SAGE Research Methods Foundations. doi: 10.4135/9781526421036885885

`ss`

, `sm`

, `gsm`

`fitted.values`

and `residuals`

## for 'ss' and 'sm' objects, this function is defined as function(object, ...){ sum(weighted.residuals(object)^2, na.rm = TRUE) } ## for 'gsm' objects, this function is defined as function(object, ...){ object$deviance }

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.