Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data:
2.415501 2.168898 2.432098 2.174328 2.099661 2.935423 3.093037 2.592143 2.918949 2.446107 2.710854 2.767778 2.563861 2.495448 2.605549 0.311995 0.441616 0.613067 0.330705 0.3153 1.868836 2.279893 1.925244 2.016123 1.962435 11.38193 11.99706 10.91963 10.51255 11.01243 8.372417 8.372197 8.385193 8.374125 8.493866 9.727474 9.566179 9.647527 9.654252 9.721341 9.251006 9.232507 9.323701 9.327206 9.184279 8.424305 8.464963 8.369531 8.46022 8.218574 10.94917 11.05125 10.95004 11.08956 11.09863 21.84242 21.9329 21.86025 21.98834 21.75776 4.795404 2.768361 6.302546 5.747964 4.97656 6.101135 5.355104 7.949373 5.200136 10.36058 4.884692 5.88694 4.627236 3.955215 3.716566 0.469301 2.998476 8.172923 0.661611 14.48802 3.978947 16.46926 5.7242 22.91694 4.730297 18.076 17.02052 12.88293 15.96065 30.57997 9.479219 9.72243 9.353061 9.266094 9.522945 10.79383 11.35194 11.00506 10.91055 10.6876 11.16994 10.43821 10.3213 10.42881 10.34557 6.990142 7.137126 7.110222 7.649185 7.031722 8.697682 9.784826 9.47703 8.849795 9.363136 21.5911 20.45157 22.31552 21.79925 23.37978 2.785366 1.912723 2.267011 3.596483 3.09791 2.5305 3.531426 3.931306 2.690987 3.217676 4.091431 2.974305 3.038909 3.392431 2.575394 0.840687 0.485394 2.008808 1.857449 0.704541 2.185337 3.051988 3.629777 2.624311 2.332169 10.54211 11.67797 11.51093 10.53084 11.57712 1.570445 1.179703 0.898674 2.30918 1.827396 3.921568 3.486165 3.038736 3.699757 3.165028 3.437124 3.359138 2.553545 3.66227 2.78473 15.02523 14.63072 17.9196 17.9862 17.42762 28.77732 29.70086 29.67406 29.97339 28.19492 54.00367 44.69015 56.01736 58.00124 48.63852 67.63428 67.21798 62.4444 61.18613 63.79298 63.67079 66.77854 59.97629 58.94496 50.28302 71.34461 75.22542 73.118 71.97693 74.61436 47.83433 53.32855 52.09002 51.1835 51.22788 51.8108 51.41196 51.88306 54.02332 54.65742 72.30468 74.73261 72.75586 74.71005 77.57959 36.83874 26.48831 26.37389 22.00326 26.35999 11.347 10.1328 11.99913 9.675818 9.564528 35.06803 32.45084 30.65876 32.12157 21.22439 21.87961 38.20977 30.14414 38.75254 32.38573 24.5019 22.2378 16.28407 22.38315 32.6859 13.77774 24.41801 17.74343 29.21505 22.3633 0.231542 0.228083 0.202333 0.265579 0.257704 0.479409 0.476073 0.45186 0.639742 0.399069 0.525001 0.478163 0.482055 0.47458 0.525368 0.000233 0.001165 0.000233 0.000233 0.001983 0.005362 0.001946 0.000233 0.000233 0.000233 2.750911 2.692129 2.564798 2.874107 2.574412 0.144549 0.138649 0.127347 0.145853 0.186378 0.209628 0.174145 0.224251 0.178994 0.142025 0.185612 0.200934 0.19839 0.180866 0.164333 0.000233 0.000233 0.000233 0.000233 0.000233 0.000233 0.000233 0.000233 0.000233 0.000233 1.480102 1.372283 1.274223 1.395392 1.262618 11.50606 12.09423 10.50466 10.64118 9.762154 16.10544 15.58351 14.03411 11.31524 8.807919 15.97569 15.9958 15.73043 15.34005 14.86126 8.634942 8.859185 9.009516 8.15617 7.933419 7.956436 8.464923 7.821401 8.134938 7.699527 14.82083 15.67597 15.56095 15.54941 16.35226
Type of transformation
Full Box-Cox transform
Full Box-Cox transform
Simple Box-Cox transform
Minimum lambda
-2
-2
-8
-7
-6
-5
-4
-3
-2
-1
Maximum lambda
2
2
1
2
3
4
5
6
7
8
Constant term to be added before analysis is performed
(?)
Display table with original and transformed data?
No
No
Yes
Chart options
R Code
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')
Compute
Summary of computational transaction
Raw Input
view raw input (R code)
Raw Output
view raw output of R engine
Computing time
0 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation