Last data update: 2014.03.03

R: Estimate log Transformation Parameter
logtransR Documentation

Estimate log Transformation Parameter

Description

Find and optionally plot the marginal (profile) likelihood for alpha for a transformation model of the form log(y + alpha) ~ x1 + x2 + ....

Usage

logtrans(object, ...)

## Default S3 method:
logtrans(object, ..., alpha = seq(0.5, 6, by = 0.25) - min(y),
         plotit = TRUE, interp =, xlab = "alpha",
         ylab = "log Likelihood")

## S3 method for class 'formula'
logtrans(object, data, ...)

## S3 method for class 'lm'
logtrans(object, ...)

Arguments

object

Fitted linear model object, or formula defining the untransformed model that is y ~ x1 + x2 + .... The function is generic.

...

If object is a formula, this argument may specify a data frame as for lm.

alpha

Set of values for the transformation parameter, alpha.

plotit

Should plotting be done?

interp

Should the marginal log-likelihood be interpolated with a spline approximation? (Default is TRUE if plotting is to be done and the number of real points is less than 100.)

xlab

as for plot.

ylab

as for plot.

data

optional data argument for lm fit.

Value

List with components x (for alpha) and y (for the marginal log-likelihood values).

Side Effects

A plot of the marginal log-likelihood is produced, if requested, together with an approximate mle and 95% confidence interval.

References

Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth edition. Springer.

See Also

boxcox

Examples

logtrans(Days ~ Age*Sex*Eth*Lrn, data = quine,
         alpha = seq(0.75, 6.5, len=20))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(MASS)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MASS/logtrans.Rd_%03d_medium.png", width=480, height=480)
> ### Name: logtrans
> ### Title: Estimate log Transformation Parameter
> ### Aliases: logtrans logtrans.formula logtrans.lm logtrans.default
> ### Keywords: regression models hplot
> 
> ### ** Examples
> 
> logtrans(Days ~ Age*Sex*Eth*Lrn, data = quine,
+          alpha = seq(0.75, 6.5, len=20))
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>