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, ...)
"invTranPlot"(x, data, subset, na.action, ...)
"invTranPlot"(x, y, lambda=c(-1, 0, 1), robust=FALSE, 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 = "x", labels, id.n = if(id.method[1]=="identify") Inf else 0, id.cex=1, id.col=palette()[1], id.location="lr", grid=TRUE, ...)
invTranEstimate(x, y, family="bcPower", confidence=0.95, robust=FALSE)
lm
, select a subset of the caseslm
, the action for missing dataFALSE
. "bcPower"
,
"yjPower"
, or a user-defined family.FALSE
, or if robust=TRUE
,
no interval is returned.pch
argument, rather than colors.palette
"auto"
, in which case a legend is added to
the plot, either above the top marign or in the bottom right or top right corner.
Set to NULL to suppress the legend.id.n=0
for labeling no points. See
showLabels
for details of these arguments.
pch
.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.
Pendergast, L, and Sheather, S. (in press). On sensitivity of response plot estimation of a robust estimation approach. Scandinavian Journal of Statistics.
Weisberg, S. (2014) Applied Linear Regression, Fourth Edition, Wiley Wiley.
inverseResponsePlot
,optimize
with(UN, invTranPlot(gdp, infant.mortality))
with(UN, invTranEstimate(gdp, infant.mortality))
Run the code above in your browser using DataCamp Workspace