inv.tran.plot
draws a two-dimensional scatterplot of $Y$ versus
$X$, along with the OLS
fit from the regression of $Y$ on
$(X^{\lambda}-1)/\lambda$. 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=FALSE,...)
inv.tran.estimate(x,y,family="box.cox",...)
"box.cox"
,
"yeo.johnson"
, or a user-defined family.locator
to find it; if FALSE do not draw a key. If a vector of length 2, draw
the upper left corner of the key at that point.inv.tran.plot
returns a graph and a data.frame with $\lambda$ in the
first column, and the residual sum of squares from the regression
for that $\lambda$ 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.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))
Run the code above in your browser using DataLab