Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_boxcoxnorm.wasp
Title produced by softwareBox-Cox Normality Plot
Date of computationTue, 06 Apr 2021 21:46:55 +0200
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2021/Apr/06/t1617738543h55xg4secz5rsn8.htm/, Retrieved Sat, 04 May 2024 00:39:04 +0200
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=, Retrieved Sat, 04 May 2024 00:39:04 +0200
QR Codes:

Original text written by user:
IsPrivate?This computation is private
User-defined keywords
Estimated Impact0
Dataseries X:
750
751
752
751
753
754
755
756
757
758
759
760
762
763
764
765
766
767
768
770
770
771
773
774
775
777
777
778
780
781
782
783
784
786
787
788
790
791
791
792
794
795
796
798
799
800
801
803
804
806
807
808
810
811
812
814
815
816
817
819
821
822
823
824
826
827
829
830
831
832
833
834
835
837
838
839
840
842
843
844
845
846
848
848
850
852
852
853
854
855
857
857
857
858
859
861
861
862
863
864
864
864
865
866
868
868
869
869
869
870
871
872
872
872
873
873
875
875
875
876
877
877
878
879
878
878
879
879
881
882
881
880
881
882
882
881
881
881
882
882
883
884
884
884
884
883
883
882
882
882
883
883
883
884
883
882
883
883
883
882
882
881
881
881
881
883
879
878
879
879
878
877
877
877
877
877
876
876
876
875
875
875
874
873
873
872
873
872
872
872
871
871
871
871
870
870
868
867
867
867
867
867
866
866
865
863
863
865
863
861
861
861
861
860
861
859
859
858
857
858
858
855
855
855
857
856
854
854
852
853
853
852
851
850
851
849
850
849
848
848
847
846
846
845
845
844
843
842
841
842
843
842
841
841
840
840
840
820
840
840
840
838
838
838
837
837
839
837
835
836
836
835
837
835
835
836
833
832
834
833
831
833
834
833
832
832
831
831
832
832
835
836
832
831
829
833
834
833
833
830
830
831
831
832
832
832
829
831
832
832
833
833
834
833
834
834
836
837
838
837
839
838
839
839
837
840
841
842
844
841
845
840
848
842
837
846
847
847
846
850
846
850
847
852
853
850
853
849
855
850
855
855
852
857
852
860
857
858
860
858
864
860
862
862
862
867
862
868
866
869
871
868
872
869
873
873
873
876
872
876
874
877
879
877
877
877
879
880
883
883
883
882
884
886
886
888
887
887
887
889
891
894
896
895
895
896
896
898
900
901
900
898
896
900
900
899
900
898
900
900
902
904
905
905
905
905
906
909
911
909
906
906
907
906
908
908
910
907
907
907
906
910
909
907
903
903
903
907
909
906
903
904
905
910
906
904
903
902
901
901
899
895
892
893
893
893
890
887
888
888
890
889
881
879
880
879
881
879
877
873
870
871
871
871
870
865
861
859
860
859
858
854
850
845
842
842
841
841
841
841
836
833
831
829
828
828
828
823
821
825
823
818
818
813
811
810
810
808
807
803
804
803
800
798
797
793
793
793
791
791
787
785
784
784
782
782
781
779
779
775
775
774
771
771
770
770
770
751
756
755
755
755
753
752
752
751
751
751
751
749
750
751
751
752
752
753
755
755
756
757
758
758
760
760
763
764
765
766
767
767
768
769
771
772
773
774
774
775
777
778
780
781
782
782
784
786
787
787
787
788
790
790
792
794
794
794
797
798
799
800
802
803
804
806
807
809
810
811
812
814
815
816
816
818
819
820
822
824
824
826
827
828
830
831
832
833
835
836
837
839
840
841
842
844
845
846
847
848
849
851
851
853
854
855
857
858
859
861
862
863
864
866
866
868
868
869
871
872
873
875
876
876
877
879
881
881
881
881
882
883
884
885
886
887
888
888
890
890
891
892
892
892
893
894
894
894
895
897
896
896
897
898
899
898
898
900
900
900
900
900
901
901
902
902
901
901
902
903
902
901
902
902
901
901
901
901
901
901
902
902
902
902
902
902
902
901
901
900
900
900
901
901
900
899
898
898
898
897
896
895
895
896
895
895
895
893
893
892
893
893
892
891
890
891
890
889
888
888
888
887
886
886
886
885
885
885
885
886
885
883
882
882
882
882
881
880
880
879
878
879
879
878
877
876
874
875
875
873
871
871
871
871
870
870
868
867
868
868
867
865
865
864
863
864
864
863
862
861
860
860
859
859
858
857
858
856
856
857
859
856
854
854
855
856
853
851
851
851
851
852
850
832
849
850
850
847
847
846
846
846
845
846
845
844
845
844
843
842
843
844
843
841
842
843
842
842
842
840
842
840
839
841
840
839
840
840
840
840
840
841
840
841
842
841
842
843
842
844
847
848
849
844
848
844
850
847
847
850
845
849
846
846
848
847
847
847
849
850
851
854
853
850
851
852
854
857
857
861
863
865
862
858
863
859
864
865
866
862
862
864
862
867
867
870
867
868
870
867
871
872
878
874
871
875
874
878
878
883
879
878
880
878
882
883
885
883
881
883
884
888
889
891
890
892
892
892
895
896
897
894
895
897
897
901
899
902
903
909
906
908
910
911
913
914
916
917
917
916
915
913
911
912
912
910
913
916
919
918
918
918
918
925
920
917
916
914
914
913
917
917
916
916
917
918
923
924
920
918
914
914
911
914
914
914
912
911
910
910
913
914
913
909
905
902
904
902
900
897
895
893
892
893
893
891
888
887
884
884
884
883
879
877
875
874
877
873
867
864
862
862
860
861
858
857
853
854
849
852
845
846
841
841
838
838
838
835
836
829
829
826
824
824
820
821
817
814
814
810
809
810
807
806
806
802
800
798
797
796
794
791
789
788
787
786
786
784
784
782
779
778
777
776
776
776
773
773
771
770
768
766
766
766
764
763
761
760
761
760
758
757
756
755
755
754
754
752
751
751
750
750
751
752
752
754
753
754
755
756
757
759
759
759
760
761
762
763
763
765
765
766
769
769
769
771
772
773
774
775
776
777
777
779
780
781
782
783
784
785
787
788
787
790
791
792
793
795
795
795
797
798
799
801
802
802
804
806
807
808
810
811
812
813
815
816
817
819
820
821
823
825
825
827
829
830
831
833
834
835
836
838
839
840
842
843
843
845
847
848
850
851
852
853
855
856
857
858
859
861
862
864
865
865
867
868
869
871
872
872
873
875
876
877
878
878
880
881
881
882
884
884
885
885
888
888
888
889
890
892
892
895
893
894
894
895
895
897
898
898
897
899
901
901
901
900
902
902
903
903
903
904
903
904
904
907
906
906
906
907
907
906
907
908
907
907
907
906
906
906
905
905
901
900
900
899
899
899
898
897
896
896
895
896
895
896
895
894
893
893
893
893
892
891
890
892
891
891
890
889
890
889
888
888
887
888
887
887
887
886
885
884
883
883
882
881
881
880
880
879
878
878
877
876
875
875
875
875
874
873
874
875
874
872
871
870
870
869
870
870
867
866
866
866
865
865
865
863
862
861
857
856
857
857
855
854
853
853
852
850
851
853
853
851
850
851
852
851
849
848
853
852
852
852
849
849
848
848
847
847
848
848
847
850
847
849
847
846
847
849
849
851
850
848
849
845
846
849
848
850
851
848
847
848
849
850
852
852
849
850
849
850
853
852
850
853
853
853
854
854
856
854
852
854
854
856
855
856
856
855
857
858
860
861
861
864
864
863
866
864
868
875
871
869
871
871
877
871
877
874
876
877
873
877
873
878
879
878
884
881
884
884
885
885
883
886
886
890
889
888
890
888
894
894
892
894
894
894
895
917
914
915
916
921
917
920
920
921
922
923
923
921
921
918
919
920
920
921
920
921
921
920
923
925
925
922
923
920
922
922
919
919
919
919
919
918
922
920
922
917
917
915
914
915
913
914
912
914
908
909
907
908
906
904
903
899
899
896
897
894
893
891
890
889
888
886
883
884
880
880
876
875
869
869
867
866
864
861
859
857
857
857
852
849
848
844
845
844
841
839
838
836
833
830
829
829
828
828
826
822
822
819
820
817
813
813
811
808
808
805
801
801
799
798
796
795
793
792
792
791
790
788
785
784
783
778
781
780
778
777
776
775
774
772
772
771
769
769
768
766
766
764
762
762
761
761
759
758
758
758
757
756
754
753
753
751
750
750
750




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time2 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]2 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R ServerBig Analytics Cloud Computing Center







Box-Cox Normality Plot
# observations x1677
maximum correlation0.988512059760626
optimal lambda8
transformation formulafor all lambda <> 0 : T(Y) = (Y^lambda - 1) / lambda

\begin{tabular}{lllllllll}
\hline
Box-Cox Normality Plot \tabularnewline
# observations x & 1677 \tabularnewline
maximum correlation & 0.988512059760626 \tabularnewline
optimal lambda & 8 \tabularnewline
transformation formula & for all lambda <> 0 : T(Y) = (Y^lambda - 1) / lambda \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=&T=1

[TABLE]
[ROW][C]Box-Cox Normality Plot[/C][/ROW]
[ROW][C]# observations x[/C][C]1677[/C][/ROW]
[ROW][C]maximum correlation[/C][C]0.988512059760626[/C][/ROW]
[ROW][C]optimal lambda[/C][C]8[/C][/ROW]
[ROW][C]transformation formula[/C][C]for all lambda <> 0 : T(Y) = (Y^lambda - 1) / lambda[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Box-Cox Normality Plot
# observations x1677
maximum correlation0.988512059760626
optimal lambda8
transformation formulafor all lambda <> 0 : T(Y) = (Y^lambda - 1) / lambda







Maximum Likelihood Estimation of Lambda
> summary(mypT)
bcPower Transformation to Normality 
  Est Power Rounded Pwr Wald Lwr Bnd Wald Upr Bnd
x    7.0691        7.07       6.1439       7.9943
Likelihood ratio test that transformation parameter is equal to 0
 (log transformation)
                           LRT df       pval
LR test, lambda = (0) 236.7434  1 < 2.22e-16
Likelihood ratio test that no transformation is needed
                           LRT df       pval
LR test, lambda = (1) 173.4809  1 < 2.22e-16

\begin{tabular}{lllllllll}
\hline
Maximum Likelihood Estimation of Lambda \tabularnewline
> summary(mypT)
bcPower Transformation to Normality 
  Est Power Rounded Pwr Wald Lwr Bnd Wald Upr Bnd
x    7.0691        7.07       6.1439       7.9943
Likelihood ratio test that transformation parameter is equal to 0
 (log transformation)
                           LRT df       pval
LR test, lambda = (0) 236.7434  1 < 2.22e-16
Likelihood ratio test that no transformation is needed
                           LRT df       pval
LR test, lambda = (1) 173.4809  1 < 2.22e-16
\tabularnewline \hline \end{tabular} %Source: https://freestatistics.org/blog/index.php?pk=&T=2

[TABLE]
[ROW][C]Maximum Likelihood Estimation of Lambda[/C][/ROW]
[ROW][C]
> summary(mypT)
bcPower Transformation to Normality 
  Est Power Rounded Pwr Wald Lwr Bnd Wald Upr Bnd
x    7.0691        7.07       6.1439       7.9943
Likelihood ratio test that transformation parameter is equal to 0
 (log transformation)
                           LRT df       pval
LR test, lambda = (0) 236.7434  1 < 2.22e-16
Likelihood ratio test that no transformation is needed
                           LRT df       pval
LR test, lambda = (1) 173.4809  1 < 2.22e-16
[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=&T=2

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Maximum Likelihood Estimation of Lambda
> summary(mypT)
bcPower Transformation to Normality 
  Est Power Rounded Pwr Wald Lwr Bnd Wald Upr Bnd
x    7.0691        7.07       6.1439       7.9943
Likelihood ratio test that transformation parameter is equal to 0
 (log transformation)
                           LRT df       pval
LR test, lambda = (0) 236.7434  1 < 2.22e-16
Likelihood ratio test that no transformation is needed
                           LRT df       pval
LR test, lambda = (1) 173.4809  1 < 2.22e-16



Parameters (Session):
par1 = Full Box-Cox transform ; par2 = -2 ; par3 = 8 ; par4 = 0 ; par5 = No ;
Parameters (R input):
par1 = Full Box-Cox transform ; par2 = -2 ; par3 = 8 ; par4 = 0 ; par5 = No ;
R code (references can be found in the software module):
par5 <- 'No'
par4 <- '0'
par3 <- '2'
par2 <- '-2'
par1 <- 'Full Box-Cox transform'
library(car)
par2 <- abs(as.numeric(par2)*100)
par3 <- as.numeric(par3)*100
if(par4=='') par4 <- 0
par4 <- as.numeric(par4)
numlam <- par2 + par3 + 1
x <- x + par4
n <- length(x)
c <- array(NA,dim=c(numlam))
l <- array(NA,dim=c(numlam))
mx <- -1
mxli <- -999
for (i in 1:numlam)
{
l[i] <- (i-par2-1)/100
if (l[i] != 0)
{
if (par1 == 'Full Box-Cox transform') x1 <- (x^l[i] - 1) / l[i]
if (par1 == 'Simple Box-Cox transform') x1 <- x^l[i]
} else {
x1 <- log(x)
}
c[i] <- cor(qnorm(ppoints(x), mean=0, sd=1),sort(x1))
if (mx < c[i])
{
mx <- c[i]
mxli <- l[i]
x1.best <- x1
}
}
print(c)
print(mx)
print(mxli)
print(x1.best)
if (mxli != 0)
{
if (par1 == 'Full Box-Cox transform') x1 <- (x^mxli - 1) / mxli
if (par1 == 'Simple Box-Cox transform') x1 <- x^mxli
} else {
x1 <- log(x)
}
mypT <- powerTransform(x)
summary(mypT)
bitmap(file='test1.png')
plot(l,c,main='Box-Cox Normality Plot', xlab='Lambda',ylab='correlation')
mtext(paste('Optimal Lambda =',mxli))
grid()
dev.off()
bitmap(file='test2.png')
hist(x,main='Histogram of Original Data',xlab='X',ylab='frequency')
grid()
dev.off()
bitmap(file='test3.png')
hist(x1,main='Histogram of Transformed Data', xlab='X',ylab='frequency')
grid()
dev.off()
bitmap(file='test4.png')
qqPlot(x)
grid()
mtext('Original Data')
dev.off()
bitmap(file='test5.png')
qqPlot(x1)
grid()
mtext('Transformed Data')
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Box-Cox Normality Plot',2,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'# observations x',header=TRUE)
a<-table.element(a,n)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'maximum correlation',header=TRUE)
a<-table.element(a,mx)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'optimal lambda',header=TRUE)
a<-table.element(a,mxli)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'transformation formula',header=TRUE)
if (par1 == 'Full Box-Cox transform') {
a<-table.element(a,'for all lambda <> 0 : T(Y) = (Y^lambda - 1) / lambda')
} else {
a<-table.element(a,'for all lambda <> 0 : T(Y) = Y^lambda')
}
a<-table.row.end(a)
if(mx<0) {
a<-table.row.start(a)
a<-table.element(a,'Warning: maximum correlation is negative! The Box-Cox transformation must not be used.',2)
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')
if(par5=='Yes') {
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Obs.',header=T)
a<-table.element(a,'Original',header=T)
a<-table.element(a,'Transformed',header=T)
a<-table.row.end(a)
for (i in 1:n) {
a<-table.row.start(a)
a<-table.element(a,i)
a<-table.element(a,x[i])
a<-table.element(a,x1.best[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')
}
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Maximum Likelihood Estimation of Lambda',1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,paste('
',RC.texteval('summary(mypT)'),'
',sep=''))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable3.tab')