residuals: Residuals

Description Usage Arguments Value Author(s) Examples

View source: R/residuals.R

Description

residuals is a function which extracts model residuals from objects returned by modeling functions.

Usage

1
residuals(model,residual = "deviance")

Arguments

model

an object for which the extraction of model residuals is meaningful.

residual

type of residual to be used.

Value

Residuals extracted from the object object.

Author(s)

Manoel Santos-Neto [email protected], F.J.A. Cysneiros [email protected], Victor Leiva [email protected] and Michelli Barros [email protected]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
##
library(alr3)
data(landrent)
attach(landrent)
resp <- I(Y/X1)
y1 <-  split(resp, X4)$"1"
x21 <-  split(X2, X4)$"1"

##Fixed Precision
fit0 <- gamlss(y1 ~ x21, family=RBS(mu.link="identity"),method=CG()  )
plot(fitted(fit0),residuals(fit0),xlab="fitted values",ylab="Deviance")
##Varying Precision
fit1 <- gamlss(y1 ~ x21,sigma.formula = y1 ~x21, family=RBS(mu.link="identity",sigma.link="sqrt"),method=CG()  )
plot(fitted(fit1),residuals(fit1),xlab="fitted values",ylab="Deviance")

santosneto/rbsmodels documentation built on May 26, 2017, 12:32 a.m.