invTranPlot {car} | R Documentation |
invTranPlot
draws a two-dimensional scatterplot of Y versus
X, along with the OLS
fit from the regression of Y on
(Y^(lam)-1)/lam. invTranEstimate
finds the nonlinear least squares estimate of lambda and its
standard error.
invTranPlot(x, ...) ## S3 method for class 'formula' invTranPlot(x, data, subset, na.action, ...) ## Default S3 method: invTranPlot(x, y, lambda=c(-1, 0, 1), lty.lines=rep(c("solid", "dashed", "dotdash", "longdash", "twodash"), length=1 + length(lambda)), lwd.lines=2, col=palette()[1], col.lines=palette(), xlab=deparse(substitute(x)), ylab=deparse(substitute(y)), family="bcPower", optimal=TRUE, key="auto", id.method = abs(residuals(lm(y~x))), labels, id.n = if(id.method[1]=="identify") Inf else 0, id.cex=1, id.col=palette()[1], grid=TRUE, ...) invTranEstimate(x, y, family="bcPower", confidence=0.95)
x |
The predictor variable, or a formula with a single response and a single predictor |
y |
The response variable |
data |
An optional data frame to get the data for the formula |
subset |
Optional, as in |
na.action |
Optional, as in |
lambda |
The powers used in the plot. The optimal power than minimizes
the residual sum of squares is always added unless optimal is |
family |
The transformation family to use, |
confidence |
returns a profile likelihood confidence interval for the optimal
transformation with this confidence level. If |
optimal |
Include the optimal value of lambda? |
lty.lines |
line types corresponding to the powers |
lwd.lines |
the width of the plotted lines, defaults to 2 times the standard |
col |
color(s) of the points in the plot. If you wish to distinguish points
according to the levels of a factor, we recommend using symbols, specified with
the |
col.lines |
color of the fitted lines corresponding to the powers. The
default is to use the colors returned by |
key |
The default is |
xlab |
Label for the horizontal axis. |
ylab |
Label for the vertical axis. |
id.method,labels,id.n,id.cex,id.col |
Arguments for the labelling of
points. The default is |
... |
Additional arguments passed to the plot method, such as |
grid |
If TRUE, the default, a light-gray background grid is put on the graph |
invTranPlot
plots a graph and returns a data frame with lam in the
first column, and the residual sum of squares from the regression
for that lam in the second column.
invTranEstimate
returns a list with elements lambda
for the
estimate, se
for its standard error, and RSS
, the minimum
value of the residual sum of squares.
Sanford Weisberg, sandy@stat.umn.edu
Fox, J. and Weisberg, S. (2011) An R Companion to Applied Regression, Second Edition, Sage.
Weisberg, S. (2005) Applied Linear Regression, Third Edition. Wiley.
with(UN, invTranPlot(gdp, infant.mortality)) with(UN, invTranEstimate(gdp, infant.mortality))