Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data:
14.123.21.1986 59.20.22.1986 17.443.22.1987 2.276.22.1991 96.295.24.1972 15.344.24.1994 14.90.24.1995 202.242.27.1968 46.226.28.1987 46.262.30.1949 57.279.32.1978 125.165.35.1973 30.242.36.1982 62.905.37.1980 16.355.37.1994 17.375.40.1996 37.135.42.1992 148.171.44.1972 110.284.47.1987 16.242.47.1989 30.371.50.1984 61.115.51.1961 27.355.56.1988 45.355.61.1987 15.835.61.1982 25.223.62.1852 203.172.66.1943 646.62.67.1970 59.191.68.1922 27.411.69.1987 31.274.69.1996 532.130.69.1947 52.100.75.1975 87.80.76.1963 27.235.78.1982 291.392.80.1948 9.410.81.1991 24.464.82.1976 49.650.85.1981 24.558.87.1986 323.317.87.1961 69.495.89.1994 21.535.89.1983 212.123.97.1969 14.717.97.1992 38.481.98.1991 22.54.98.1964 77.379.100.1967 290.168.109.1982 386.82.112.1970 50.355.119.1986 144.95.121.1984 48.240.121.1991 33.448.122.1978 29.255.124.1985 58.448.126.1990 71.392.126.1980 135.475.134.1967 183.85.137.1979 573.108.138.1941 268.394.138.1973 57.336.140.1930 52.565.143.1978 21.255.144.1974 479.165.147.1960 77.99.150.1865 89.203.151.1953 83.318.154.1970 59.476.162.1990 67.473.164.1979 225.186.170.1978 56.170.179.1985 36.824.180.1981 101.805.183.1973 288.132.183.1969 183.50.188.1925 25.424.188.1992 120.130.189.1945 263.90.193.1964 101.805.214.1977 43.96.220.1948 73.448.224.1982 221.130.227.1980 83.595.237.1970 37.474.239.1984 185.410.245.1977 61.395.245.1981 57.437.249.1985 186.270.254.1948 199.265.261.1963 165.899.264.1992 95.133.292.1967 82.262.294.1963 214.506.299.1962 152.1140.302.1981 33.211.313.1844 81.799.313.1983 137.760.317.1982 59.442.338.1982 98.296.339.1898 163.272.351.1976 462.45.355.1967 99.614.370.1971 52.436.382.1971 47.481.383.1990 394.95.388.1966 227.357.388.1964 65.280.390.1985 242.142.397.1961 154.710.406.1979 45.490.412.1988 81.870.412.1986 79.1147.418.1974 120.743.427.1981 91.759.440.1967 218.36.445.1975 97.224.488.1971 322.82.495.1970 283.160.497.1953 40.1170.499.1989 552.90.502.1948 222.742.508.1964 29.575.544.1992 390.163.545.1947 95.175.547.1988 305.120.556.1967 98.590.574.1981 146.2120.578.1958 271.205.582.1949 515.128.597.1952 172.1539.602.1977 127.346.617.1939 58.1046.636.1979 524.97.646.1932 222.686.654.1964 385.914.662.1981 413.85.670.1964 366.206.684.1962 75.1154.698.1980 238.45.700.1972 142.1146.707.1974 437.95.730.1925 269.138.733.1983 643.115.737.1941 230.640.787.1974 313.122.825.1933 512.110.834.1969 211.923.838.1971 171.1000.871.1966 34.1234.922.1972 81.1492.930.1978 144.810.957.1982 190.90.988.1983 339.177.1039.1970 771.74.1083.1928 522.113.1113.1966 284.145.1113.1960 202.590.1152.1974 118.1154.1243.1969 160.1450.1408.1973 141.1431.1437.1972 972.47.1530.1963 542.45.1580.1968 866.47.1583.1987 267.81.1812.1918 186.1010.1860.1975 558.334.2022.1954 523.190.2331.1919 325.180.2411.1933 129.1893.2479.1973 165.1400.2514.1969 531.301.2540.1890 231.1339.2676.1974 536.90.2762.1974 487.310.2800.1971 799.226.3791.1945 660.148.4138.1886 737.159.6697.1892 346.178.7943.1932 1098.47.8999.1911
Type of transformation
Simple Box-Cox transform
Full Box-Cox transform
Simple Box-Cox transform
Minimum lambda
-4
-2
-8
-7
-6
-5
-4
-3
-2
-1
Maximum lambda
4
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 <- '4' par2 <- '-4' par1 <- 'Simple 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