Ydiagnostics {expandFunctions}R Documentation

Informative plots for Y and Yhat

Description

This function presents diagnostic plots of estimate Yhat and response Y.

Usage

Ydiagnostics(Y, Yhat, ...)

Arguments

Y

R object representing response, coercible to a vector.

Yhat

R object representing estimate, coercible to a vector. The length of Y and Yhat must be equal.

...

Options for cor function. The defaults are use = "everything" and method = "pearson".

Details

The plots shown are:

Value

Invisibly returns TRUE; this routine is only used for its graphical side effects described in Details.

See Also

cor

Examples

# The order here looks backwards, but is chosen to
# simulate a typical pair - Yhat will normally have
# a smaller range than Y.
set.seed(2)
nObs <- 100 # Number of observations
x <- stats::filter(rnorm(nObs),c(-0.99),
     method="recursive")
x <- x + (x^2) # Nonlinear component
myLags <- 0:2
X <- eTrim(eLag(x,myLags))
Y <- X[,+1,drop=FALSE]
X <- X[,-1,drop=FALSE]
lmObj <- lm(Y ~ X)
Yhat <- predict(lmObj)
Ydiagnostics(Y,Yhat)

[Package expandFunctions version 0.1.0 Index]