GithubHelp home page GithubHelp logo

jtrans's Introduction

jtrans 0.1

Why should someone use this package?

This package gives a simple solution for normality transformation based on the newest transformation algorithm by Chou, Youn Min; Polansky, A. M. M. R. L. (1998). The rich options it provides can be used for simulations on the algorithm. It uses standard S3 class and methods, so it's an small but indispensable building block for statistical procedures which have the problem of non-normality.

How does it compare to other existing solutions?

There are now two packages on CRAN can do Johnson normality transformations, Johnson by Edgar Santos Fernandez and JohnsonDistribution by A.I. McLeod and Leanna King. However, both of them have certain limitations to performing easy and correct normality transformation.

Although Johnson package is also based on the algorithm by Chou, Youn Min; Polansky, A. M. M. R. L. (1998), it's a C style implementation and hasn't been vectorized, so it's hard to debug and it generally takes 10 times longer than jtrans. It implementes the sample quantile function in a non-standard way (different from the quantile function from stats package), which will lead to errors in the following calculations.

JohnsonDistribution package is based on I. D. Hill (1976). It aims to provide Johnson curve distribution and estimation functions, so the design concept is slightly different from Johnson normality transformation.

What are the main functions?

jtrans is the main function. Import is a numeric vector of non-normal data. Output is the transformed data with Johnson curve and parameters. The Shapiro-Wilk test is used by default, and the p.value of the transformed data will also be returned.

jtrans's People

Contributors

wangyuchen avatar

Watchers

 avatar

jtrans's Issues

Clarification on "Jtrans" package

Recently, I came across an R-package "jtrans" and found to be very useful. I would like to clarify the following doubts regarding the package.

  1. How do I back transform the data?
  2. I have a non-normal dataset which I tried to transform using the package, but didnt work. Can you suggest me a solution?

The codes are given below:

read.table(textConnection("treat repl effect1 transformed
ctrl 1 4.5568 -0.94855895
ctrl 2 7.2874 -0.61241869
ctrl 3 2.0557 -1.5307805
ctrl 4 0.8671 -2.24734323
ctrl 5 2.0416 -1.53599825
treat1 1 13.9265 -0.13786884
treat1 2 13.098667 -0.18394011
treat1 3 14.4454 -0.11019863
treat1 4 15.944 -0.03484184
treat1 5 15.307182 -0.06608971
treat2 1 37.434 0.69328341
treat2 2 37.175889 0.6864524
treat2 3 22.9898 0.25623886
treat2 4 14.8152 -0.0910007
treat2 5 14.589091 -0.10268909
treat3 1 10.0914 -0.37676977
treat3 2 14.581556 -0.1030813
treat3 3 2.1069 -1.51216859
treat3 4 1.7222 -1.6666435
treat3 5 2.516182 -1.37945895
treat4 1 28.5665 0.44154336
treat4 2 24.951333 0.32471788
treat4 3 31.5415 0.53054774
treat4 4 43.0154 0.83616312
treat4 5 30.381909 0.49651044
treat5 1 21.1001 0.18601383
treat5 2 14.885111 -0.08741789
treat5 3 17.2256 0.02497832
treat5 4 13.227 -0.17663297
treat5 5 12.561 -0.21526148
treat6 1 9.1758 -0.44606229
treat6 2 6.126222 -0.73683883
treat6 3 7.7394 -0.5691373
treat6 4 7.8217 -0.56151922
treat6 5 8.132455 -0.53343019
treat7 1 94.2584 2.3052373
treat7 2 98.629556 2.55639605
treat7 3 99.6842 2.63047148
treat7 4 90.0177 2.11485905
treat7 5 80.996182 1.79815736
treat8 1 43.508 0.84840624
treat8 2 46.841889 0.93013131
treat8 3 46.3398 0.91793466
treat8 4 42.6801 0.82780097
treat8 5 42.992273 0.8355871
treat9 1 56.5082 1.16099219
treat9 2 57.110111 1.17530181
treat9 3 52.3417 1.06202199
treat9 4 44.8252 0.88091602
treat9 5 61.326909 1.27612697
treat10 1 1.5229 -1.76342652
treat10 2 2.020444 -1.54390408
treat10 3 0.8935 -2.21915988
treat10 4 0.519 -2.81626084
treat10 5 0.907 -2.20520354
treat11 1 8.9524 -0.4639497
treat11 2 9.410111 -0.42773525
treat11 3 10.884 -0.3213404
treat11 4 7.9897 -0.54620392
treat11 5 8.716091 -0.4833343
"),header=T)->dat

jt<- jtrans(dat$effect1)
plot(density(dat$effect1))
plot(density(jt$transformed))
qqnorm(jt$transformed)
qqline(jt$transformed)
jtrans(md5$root, test = "ad.test")
predict(jt, dat$effect1)

dat$transformed<-jt$transformed
aov(transformedtreat,data=dat)->m1
shapiro.test(resid(m1))
ad.test(resid(m1))
gls(transformed
treat,data=dat)->m1
shapiro.test(resid(m1))
ad.test(resid(m1))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.