Learn R Programming

jtrans (version 0.2.1)

predict.sb: Predict functions for Johnson Transformation

Description

Generic functions to apply the fitted Johnson transformation to transform new data.

Usage

"predict"(object, newdata, ...)
"predict"(object, newdata, ...)
"predict"(object, newdata, ...)

Arguments

object
a jtrans object with a specific type
newdata
new data to be fitted
...
further arguments to match predict

Value

Numeric vector of the transformed values#'

Details

After the johnson transformation is used, if you want to use the same transformation on different data, you can use these functions. This is designed to be the same functionality as the predict functions.

Examples

Run this code
#' # if you want to predict based on a fitted distribution, you must set the
# parameters in the qtls() function using the fitted model object jt.

jt <- jtrans(rexp(300, .4))

# good prediction
predict(jt, rexp(10, .4))

# will generate NaN because newx is from different distribution
predict(jt, rexp(10, .1))

Run the code above in your browser using DataLab