trans_parameter {plaqr}R Documentation

Transformation of the Response Variable

Description

Transform the response variable using the one-paremter, symmetric transformation of Geraci and Jones (2015).

Usage

trans_parameter(x, parameter, inverse=FALSE)

Arguments

x

a vector of values to be transformed (the response variable)

parameter

a real-valued transformation parameter. 0 corresponds to the log transformation and 1 corresponds to the identity. See Geraci and Jones (2015) for more information on the one-parameter, symmetric transformation.

inverse

If TRUE, the inverse transformation is done to transform the variable back to the original scale. If FALSE, the standard transformation is computed.

Value

Returns a vector of the transformed (or back-transformed) variable.

Author(s)

Adam Maidman

References

Geraci, M. and Jones, M. (2015). Improved transformation-based quantile regression. Canadian Journal of Statistics 43, 118-132.

Maidman, A., Wang, L. (2017). New Semiparametric Method for Predicting High-Cost Patients. Preprint.

Examples

data(simData)
simData$Y <- exp(simData$y)

tparam <- transform_plaqr(Y~x1+x2+x3, nonlinVars=~z1+z2, data=simData) 

simData$newy <- trans_parameter(simData$Y, tparam$parameter)

fit <- plaqr(newy~x1+x2+x3, nonlinVars=~z1+z2, data=simData) 

trans_parameter( predictInt(fit), tparam$parameter, inverse=TRUE)

[Package plaqr version 2.0 Index]