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 computationSat, 23 Mar 2024 14:25:18 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2024/Mar/23/t1711200376cj2i07b0hwzlsrn.htm/, Retrieved Tue, 08 Sep 2026 21:12:55 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=320032, Retrieved Tue, 08 Sep 2026 21:12:55 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact299
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Box-Cox Normality Plot] [Arch] [2024-03-23 13:25:18] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
2.396720864	11.69277524	0.3512180875	0.4161499639	3.408891554	912
1.191213461	9.708384701	0.06055995247	0.7578361352	3.03544854	712
3.601010857	9.575665333	0.02804416761	0.5309562073	1.104658543	690
2.930234809	9.68994482	0.01206095529	0.2409333165	1.086614589	656
3.436806723	11.80659494	0.08175220069	0.06943482959	2.592735871	519
0.7912198652	11.28711465	0.1548464753	0.2319877853	1.849914943	658
2.658221157	9.870468953	0.01754673854	0.106545599	0.8321096872	888
4.439982176	15.29128752	0.1818015521	0.2640490318	1.864872419	240
1.695200056	10.17067719	0.2110644292	0.1617489366	1.745639361	218
3.790603645	18.02182543	0.03723813543	0.1060709306	1.042509604	120
2.57155232	9.636819189	0.01649803094	0.2665849513	1.64531823	655
3.781031911	18.46693169	0.03562664318	0.9315501322	2.188213951	750
2.137868582	9.816755483	0.1135533474	0.1718654147	3.827122804	570
1.459064454	11.62561882	0.02556635777	0.9773157084	1.712318363	830
1.046349575	9.697906627	0.05950896262	0.2228649708	1.29676268	671
2.255978284	13.00275402	0.06748196231	0.1976059871	0.847079652	828
2.916842593	16.47908474	0.009972946718	0.1242353298	0.8933177035	673
2.521415792	15.24803353	0.2269584718	0.0858561015	1.143063663	535
3.391818651	10.18873727	0.1192247442	1.856400154	1.709906724	635
2.673061703	13.57228737	0.0170422001	0.5634716081	1.858612661	806
3.760329351	7.309224859	0.2441001383	0.04247411175	1.884479992	195
1.947602945	10.47078929	0.2851496916	0.07154756699	1.658808783	160
1.055284723	12.78376747	0.04491992109	0.3638136873	0.8263075106	102
1.262173921	8.005090925	0.08063946764	0.7315986937	1.634518658	628
1.426558897	4.956211537	0.0006336088064	1.497150406	2.105705306	1123
3.009803004	13.1978374	0.06733009188	0.04587423524	1.84303423	595
5.360617152	10.8635257	0.1180054688	0.377511556	2.681927263	835
1.889379266	12.35464967	0.052368048	0.1703256178	2.040342042	630
3.744998933	11.13928089	0.04392493555	0.004993016347	0.5890968726	759
2.09225975	12.87457324	0.02306993504	0.4237985415	0.3685719431	769
1.627504229	12.43576506	0.04444621499	1.370140791	2.141128201	550
3.21949884	13.13329272	0.02509041128	1.447496502	2.81303842	611
3.450483242	12.93241814	0.01993924833	0.9852752387	1.250695088	723
1.157173434	11.06199836	0.03151291391	0.8924395619	3.308849437	120
6.188520935	15.90054489	0.05359594834	0.1255494656	0.8911675926	190
1.818726219	13.78138874	0.06172751264	0.408030878	2.230764991	135
1.02820843	8.685625308	0.08566284272	0.305803388	3.380086067	601
2.119194712	14.64818398	0.0497819351	1.032641512	1.379911004	999
2.934540282	12.96596579	0.0607763745	0.2185699734	1.56612171	545
2.300647218	14.0495861	0.03799398193	0.1591235615	1.08518608	
2.453524547	15.33941424	0.01702366878	0.173474982	1.099851115	
3.188893826	14.80273896	0.1969190946	0.9723195417	1.446197944	
4.010790926	9.441727606	0.1148175201	0.5990667338	2.337420214	
2.634973134	5.280248219	0.05389476319	0.2649087435	2.050017141	
4.394423329	14.19220479	0.1338685249	0.9841110988	0.9843199573




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time0 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 time0 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=320032&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]0 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=320032&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=320032&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 time0 seconds
R ServerBig Analytics Cloud Computing Center



Parameters (Session):
par1 = Full Box-Cox transform ; par2 = -2 ; par3 = 2 ; par4 = 0 ; par5 = No ;
Parameters (R input):
par1 = Full Box-Cox transform ; par2 = -2 ; par3 = 2 ; 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('<pre>',RC.texteval('summary(mypT)'),'</pre>',sep=''))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable3.tab')