trans_parameter: Transformation of the Response Variable

Description Usage Arguments Value Author(s) References Examples

View source: R/plaqr.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)

plaqr documentation built on May 2, 2019, 3:32 p.m.

Related to trans_parameter in plaqr...