Ydiagnostics: Informative plots for Y and Yhat

Description Usage Arguments Details Value See Also Examples

View source: R/expandFunctions.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# 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)

Example output



expandFunctions documentation built on May 2, 2019, 9:15 a.m.