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(3258.1,3140.1,3627.4,3279.4,3204,3515.6,3146.6,2271.7,3627.9,3553.4,3018.3,3355.4,3242,3311.1,4125.2,3423,3120.3,3863,3240.8,2837.4,3945,3684.1,3659.6,3769.6,3592.7,3754,4507.8,3853.2,3817.2,3958.4,3428.9,3125.7,3977,3983.3,4299.6,4306.9,4259.5,3986,4755.6,3925.6,4206.5,4323.4,3816.1,3410.7,4227.4,4296.9,4351.7,3800,4277,4100.2,4672.5,4189.9,4231.9,4654.9,4298.5,3635.9,4505.1,4891.9,4894.2,4093.2) > par5 = '12' > par4 = '1' > par3 = '0' > 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/rcomp/tmp/1tk5p1229108434.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/2992y1229108434.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.2889787269 0.1141009027 0.2153955785 -0.0580244735 [6] 0.0360524555 0.0010309610 -0.2158126939 0.1054655498 0.0417133539 [11] -0.2728991637 -0.2169808790 -0.1736351393 -0.1361042230 0.0279900800 [16] -0.0195350930 -0.0510264218 0.1191083698 -0.0034426830 -0.1514982823 [21] -0.0551671334 -0.0196189548 -0.0930665773 0.0104063011 -0.1773073451 [26] -0.2165693465 -0.0004867637 -0.0707659943 -0.1524310205 0.0522186660 [31] 0.0202094748 0.1544754913 0.1335591665 -0.0538113003 0.1535852307 [36] 0.1813869124 0.0438303812 0.0400861530 0.0266811003 0.0207830644 [41] 0.0387749289 -0.0584232110 -0.0756711091 0.0175368626 0.0085426528 [46] -0.0469223062 -0.0311889739 -0.0015232753 > (mypacf <- c(rpacf$acf)) [1] 2.889787e-01 3.337969e-02 1.899324e-01 -1.920430e-01 1.022518e-01 [6] -8.368251e-02 -1.675595e-01 2.248549e-01 -3.881004e-02 -2.686049e-01 [11] -2.123398e-01 2.700856e-02 3.098765e-02 5.930042e-02 6.020582e-02 [16] -9.543556e-02 -5.449895e-03 -4.714137e-02 -8.595850e-02 -4.457715e-02 [21] 1.947328e-02 -1.930431e-01 -3.083569e-02 -1.805802e-01 -1.413834e-01 [26] 4.368550e-02 8.198906e-02 -1.453504e-01 -3.712210e-02 2.288149e-06 [31] 1.091468e-01 -7.725884e-02 -3.264186e-02 7.773314e-02 -1.086362e-01 [36] -2.130555e-02 -1.012288e-01 1.895844e-02 -3.941118e-02 -5.182182e-02 [41] 2.689109e-02 -1.661783e-02 -3.417252e-02 -7.048688e-02 6.435528e-02 [46] -4.978244e-02 -4.870828e-02 > 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/3w7nv1229108434.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/44zk81229108434.tab") > > system("convert tmp/1tk5p1229108434.ps tmp/1tk5p1229108434.png") > system("convert tmp/2992y1229108434.ps tmp/2992y1229108434.png") > > > proc.time() user system elapsed 0.566 0.330 0.905