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(6.4,6.8,7.5,7.5,7.6,7.6,7.4,7.3,7.1,6.9,6.8,7.5,7.6,7.8,8,8.1,8.2,8.3,8.2,8,7.9,7.6,7.6,8.2,8.3,8.4,8.4,8.4,8.6,8.9,8.8,8.3,7.5,7.2,7.5,8.8,9.3,9.3,8.7,8.2,8.3,8.5,8.6,8.6,8.2,8.1,8,8.6,8.7,8.8,8.5,8.4,8.5,8.7,8.7,8.6,8.5,8.3,8.1,8.2,8.1,8.1,7.9,7.9,7.9,8,8,7.9,8,7.7,7.2,7.5,7.3,7,7,7,7.2,7.3,7.1,6.8,6.6,6.2,6.2,6.8,6.9) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '60' > #'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/rcomp/tmp/1rtju1229503313.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/rcomp/tmp/2btx81229503313.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.000000e+00 4.443988e-01 -1.062683e-01 -5.455044e-01 -5.821912e-01 [6] -1.780885e-01 1.497396e-01 3.081597e-01 2.688003e-01 8.696546e-02 [11] -8.006670e-02 -1.416301e-01 -1.830455e-01 -4.168951e-02 5.443622e-02 [16] 1.244518e-01 7.625183e-02 -6.610928e-02 -1.254112e-02 -4.840552e-02 [21] 7.506396e-02 6.613213e-02 -1.886879e-02 -7.590917e-02 -1.456963e-01 [26] -2.058205e-02 8.931835e-02 9.909539e-02 -9.137427e-05 -1.545824e-01 [31] -1.920916e-01 2.821181e-02 1.985563e-01 2.513021e-01 1.161367e-01 [36] -1.302540e-01 -2.160773e-01 -1.964318e-01 4.957054e-03 1.066338e-01 [41] 1.556789e-01 1.465415e-01 -1.617325e-02 -1.017909e-01 -1.804185e-01 [46] -9.642270e-02 4.287738e-02 1.453765e-01 1.335663e-01 6.192891e-02 [51] -5.987299e-02 -6.901042e-02 -5.758863e-02 6.670322e-03 3.186678e-02 [56] 2.170139e-03 1.893732e-02 -3.111294e-02 -2.030793e-02 2.770925e-02 [61] -6.716009e-03 > (mypacf <- c(rpacf$acf)) [1] 0.444398757 -0.378510706 -0.454077771 -0.276010853 0.045670214 [6] -0.172627914 -0.154834518 0.003989984 0.021005155 -0.048907656 [11] 0.023189855 -0.096713956 0.088481940 -0.002865953 0.021111177 [16] -0.077895979 -0.091498584 0.184830248 -0.106222228 0.118192055 [21] -0.004382127 0.001779274 -0.026337604 -0.100456503 0.108909273 [26] -0.028227913 -0.085555686 -0.154506365 -0.232242003 -0.100982185 [31] 0.050207204 0.024235353 -0.055650750 0.018850407 0.070428426 [36] -0.030132323 0.053214412 0.111456034 -0.043245608 0.020378763 [41] 0.078400185 -0.060766471 -0.019475360 -0.009883568 0.063969584 [46] -0.093828220 0.008852053 0.019343527 0.010625461 0.033839198 [51] 0.066331517 -0.072253929 0.024804361 -0.046585122 0.061813694 [56] -0.008938065 -0.008494140 -0.006814021 0.009013656 -0.018957444 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/rcomp/tmp/3uj721229503313.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/rcomp/tmp/4mh7n1229503313.tab") > > system("convert tmp/1rtju1229503313.ps tmp/1rtju1229503313.png") > system("convert tmp/2btx81229503313.ps tmp/2btx81229503313.png") > > > proc.time() user system elapsed 0.596 0.317 0.827