Description Usage Arguments Details Value References Examples
jtrans
transforms a continuous univariate vector to a random vector
from standard normal distribution.
1 2 |
x |
the non-normal numerical data. |
test |
the normality test used to select fits, defaults to
|
exclude_original |
whether the original data should be excluded when comparing fits. |
z_lim |
two values vector defining the range of the z values, defaults to 0.25 to 1.25, which is recommended by Mandraccia, Halverson and Chou (1996). |
z_length |
the length of the z vector, default to 101. The number of different fits estiamted in the algorithm. Set larger z.length value if you want extra precision. |
jtrans
fits data to a set of distributions from Johnson family. A
normality test is used to find the best fit by choosing the fit with maximum
p.value under that given test. It returns the transformed data, the
corresponding type of Johnson curve and parameter estimations.
Since the default Shapiro-Wilk test can only accept sample size between 3 and
5000, one should specify another normality test in the test parameter,
generally the ad.test
in the nortest package is
recommended.
Sometimes, this algorithm may return poor fits. The most extreme case is that
all the transformed data have smaller p.values than the original data's. In
such cases, the exclude_original
flag should be set to FALSE, so
jtrans
will return the original data as the transformed data.
A list with two classes: the first one is the type of transformation
used, the same as the type
component, could be "sb", "su" or "sl";
The second one is "jtrans". The list containsthe following components:
original |
original data. |
transformed |
transformed data. |
type |
type of transformation selected. |
test |
normality test used to select transformations. |
z |
selected z value among 101 values from 0.25 to 1.25. |
eta, gamma, lambda, epsilon |
transformation parameters. |
p.value |
the maximum p.value returned by test |
Chou, Y. M., Polansky, A. M., & Mason, R. L. (1998). Transforming non-normal data to normality in statistical process control. Journal of Quality Technology, 30(2), 133-141.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
$original
[1] 8.05029185 2.42658958 8.56480127 1.31521173 6.78969574 1.64474910
[7] 0.78276678 1.27019427 27.44403445 4.61478105 4.65597962 4.39068188
[13] 1.45102073 2.64673048 2.40475918 3.29558303 8.71586284 5.98457445
[19] 14.95957505 7.66308109 0.07733153 0.95262425 20.03546501 5.47314923
[25] 2.88208745 3.61102136 8.97810357 5.83900143 2.68698456 0.78025043
[31] 16.07549682 0.08398940 8.38401762 4.23471736 5.46332755 4.76278484
[37] 13.69844218 4.87847180 5.33254618 1.12730447 1.04179012 2.01631570
[43] 4.80568784 1.60232136 0.43243680 1.56167885 0.96830906 3.63789867
[49] 0.59688441 5.13069184
$transformed
[1] 0.9626197 -0.2300082 1.0298056 -0.7636009 0.7812069 -0.5755025
[7] -1.1652542 -0.7921418 2.4984686 0.3855747 0.3944558 0.3360207
[13] -0.6819479 -0.1499596 -0.2382804 0.0565526 1.0488888 0.6496093
[19] 1.6712476 0.9096291 -2.2018403 -1.0194395 2.0451014 0.5578397
[25] -0.0704609 0.1444624 1.0813719 0.6242013 -0.1359429 -1.1675777
[31] 1.7601998 -2.1849402 1.0065941 0.3002156 0.5560057 0.4171650
[37] 1.5646653 0.4412678 0.5313092 -0.8883009 -0.9504249 -0.3972880
[43] 0.4261625 -0.5979087 -1.5535190 -0.6198299 -1.0069603 0.1516406
[49] -1.3528584 0.4921392
$type
[1] "sb"
$test
[1] "shapiro.test"
$eta
[1] 0.99702
$gamma
[1] 3.039142
$lambda
[1] 75.50073
$epsilon
[1] -0.3141941
$z
[1] 0.73
$p.value
[1] 0.8857942
attr(,"class")
[1] "sb" "jtrans"
Loading required package: nortest
$original
[1] 8.05029185 2.42658958 8.56480127 1.31521173 6.78969574 1.64474910
[7] 0.78276678 1.27019427 27.44403445 4.61478105 4.65597962 4.39068188
[13] 1.45102073 2.64673048 2.40475918 3.29558303 8.71586284 5.98457445
[19] 14.95957505 7.66308109 0.07733153 0.95262425 20.03546501 5.47314923
[25] 2.88208745 3.61102136 8.97810357 5.83900143 2.68698456 0.78025043
[31] 16.07549682 0.08398940 8.38401762 4.23471736 5.46332755 4.76278484
[37] 13.69844218 4.87847180 5.33254618 1.12730447 1.04179012 2.01631570
[43] 4.80568784 1.60232136 0.43243680 1.56167885 0.96830906 3.63789867
[49] 0.59688441 5.13069184
$transformed
[1] 0.97377708 -0.22918326 1.04119051 -0.76600994 0.79140618 -0.57719412
[7] -1.16676797 -0.79460636 2.47782225 0.39247080 0.40143781 0.34243166
[13] -0.68411658 -0.14840276 -0.23752868 0.06013634 1.06032411 0.65885738
[19] 1.67958549 0.92055539 -2.17198477 -1.02173531 2.04507622 0.56632582
[25] -0.06814246 0.14894001 1.09287759 0.63324561 -0.13425402 -1.16907403
[31] 1.76710323 -2.15611822 1.01790909 0.30627082 0.56447597 0.42436501
[37] 1.57433380 0.44869653 0.53956261 -0.89083352 -0.95289588 -0.39783632
[43] 0.43344820 -0.59971498 -1.54953026 -0.62174123 -1.00929645 0.15619132
[49] -1.35240917 0.50003998
$type
[1] "sb"
$test
[1] "ad.test"
$eta
[1] 1.025516
$gamma
[1] 3.308965
$lambda
[1] 90.30707
$epsilon
[1] -0.3517421
$z
[1] 0.72
$p.value
[1] 0.7163152
attr(,"class")
[1] "sb" "jtrans"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.