inv.tran.plot {alr3} | R Documentation |
inv.tran.plot
draws a two-dimensional scatterplot of Y versus
X, along with the OLS
fit from the regression of Y on
(Y^(lam)-1)/lam. inv.tran.estimate
find the nonlinear least squares estimate of lambda and its
standard error.
inv.tran.plot(x,y,lambda=c(-1,0,1),lty=1:(1+length(lambda)), col=rainbow(length(lambda)+1),xlab=deparse(substitute(x)), ylab=deparse(substitute(y)),family="box.cox",optimal=TRUE, key="topleft",...) inv.tran.estimate(x,y,family="box.cox",...)
x |
The predictor variable |
y |
The response variable |
lambda |
The powers used in the plot. The optimal power than minimizes the residual sum of squares is always added unless optimal is FALSE. |
family |
The transformation family to use, |
optimal |
Include the optimal value of lambda? |
lty |
line types corresponding to the powers |
col |
color corresponding to the powers |
key |
The default is |
xlab |
Label for the horizontal axis. |
ylab |
Label for the vertical axis. |
... |
additional arguments passed to other methods. |
inv.tran.plot
returns a graph and 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.
inv.tran.estimate
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
Weisberg, S. (2005). Applied Linear Regression, third edition. New York: Wiley.
powtran
, inverse.response.plot
,
optimize
, nls
data(baeskel) attach(baeskel) inv.tran.plot(Sulfur,Tension,key=c(.6,450)) ans <-inv.tran.estimate(Sulfur,Tension) # redraw the plot, including the nls estimate inv.tran.plot(Sulfur,Tension,lambda=c(ans$lambda,-1,0,1),key=c(.6,450))