R version 2.8.0 (2008-10-20) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- c(9.026,9.787,9.536,9.490,9.736,9.694,9.647,9.753,10.070,10.137,9.984,9.732,9.103,9.155,9.308,9.394,9.948,10.177,10.002,9.728,10.002,10.063,10.018,9.960,10.236,10.893,10.756,10.940,10.997,10.827,10.166,10.186,10.457,10.368,10.244,10.511,10.812,10.738,10.171,9.721,9.897,9.828,9.924,10.371,10.846,10.413,10.709,10.662,10.570,10.297,10.635,10.872,10.296,10.383,10.431,10.574,10.653,10.805,10.872,10.625,10.407,10.463,10.556,10.646,10.702,11.353,11.346,11.451,11.964,12.574,13.031,13.812,14.544,14.931,14.886,16.005,17.064,15.168,16.050,15.839,15.137,14.954,15.648,15.305) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > if (par1 == 'Default') { + par1 = 10*log10(length(x)) + } else { + par1 <- as.numeric(par1) + } > par2 <- as.numeric(par2) > par3 <- as.numeric(par3) > par4 <- as.numeric(par4) > par5 <- as.numeric(par5) > if (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } > if (par3 > 0) x <- diff(x,lag=1,difference=par3) > if (par4 > 0) x <- diff(x,lag=par5,difference=par4) > postscript(file="/var/www/html/freestat/rcomp/tmp/1bzjo1228816176.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/28uu71228816176.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > rpacf <- pacf(x,par1,main='Partial Autocorrelation',xlab='lags',ylab='PACF') > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.0000000000 -0.0691726862 -0.1015963598 0.2674505795 0.0987692891 [6] -0.2586572909 0.0237231327 0.1713550326 -0.0272872664 -0.0797666378 [11] 0.0144898609 0.0386876526 -0.1323344148 -0.0872829835 -0.0603469212 [16] 0.0063695447 -0.0739636645 -0.0042572419 0.0357874455 0.0779855848 [21] -0.0276158708 0.0411108624 -0.0037458672 -0.0792290596 -0.0589836444 [26] 0.0944227505 -0.0094050609 -0.0153535384 0.1057483926 0.0149608512 [31] -0.0519632874 -0.0609938564 0.0633899116 -0.0965421906 -0.0691044951 [36] 0.0002989294 0.0003461249 -0.1500320623 -0.0132701628 0.0247564139 [41] 0.0313134905 -0.0355117456 -0.0047358639 0.0293519388 -0.0287235421 [46] -0.0658453595 -0.0147819744 0.1189035746 -0.0052620001 > (mypacf <- c(rpacf$acf)) [1] -0.069172686 -0.106892687 0.256420412 0.131412579 -0.215221140 [6] -0.067081920 0.101561359 0.116550385 -0.014230084 -0.138791960 [11] -0.029597805 -0.047451489 -0.040099591 -0.138502489 -0.010148079 [16] 0.002487386 0.040783191 0.001537064 0.077248020 0.025636241 [21] 0.056265956 -0.067007180 -0.118062976 -0.082926557 0.108290658 [26] 0.028695324 -0.018408502 0.003445329 0.009994441 0.032892822 [31] -0.075405338 0.012812772 -0.050952566 -0.034815866 -0.065367977 [36] -0.068409050 -0.121940902 -0.021826805 0.020860837 0.127346970 [41] 0.044022203 -0.033949867 -0.033556355 -0.009204610 -0.055297201 [46] -0.109703138 0.025120583 0.054886538 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Autocorrelation Function',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Time lag k',header=TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/basics.htm','ACF(k)','click here for more information about the Autocorrelation Function'),header=TRUE) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,'P-value',header=TRUE) > a<-table.row.end(a) > for (i in 2:(par1+1)) { + a<-table.row.start(a) + a<-table.element(a,i-1,header=TRUE) + a<-table.element(a,round(myacf[i],6)) + mytstat <- myacf[i]*sqrtn + a<-table.element(a,round(mytstat,4)) + a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/freestat/rcomp/tmp/3doa11228816176.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Partial Autocorrelation Function',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Time lag k',header=TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/basics.htm','PACF(k)','click here for more information about the Partial Autocorrelation Function'),header=TRUE) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,'P-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:par1) { + a<-table.row.start(a) + a<-table.element(a,i,header=TRUE) + a<-table.element(a,round(mypacf[i],6)) + mytstat <- mypacf[i]*sqrtn + a<-table.element(a,round(mytstat,4)) + a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/freestat/rcomp/tmp/4vzg71228816176.tab") > > system("convert tmp/1bzjo1228816176.ps tmp/1bzjo1228816176.png") > system("convert tmp/28uu71228816176.ps tmp/28uu71228816176.png") > > > proc.time() user system elapsed 0.793 0.413 0.899