R version 2.7.0 (2008-04-22) 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(13363,12530,11420,10948,10173,10602,16094,19631,17140,14345,12632,12894,11808,10673,9939,9890,9283,10131,15864,19283,16203,13919,11937,11795,11268,10522,9929,9725,9372,10068,16230,19115,18351,16265,14103,14115,13327,12618,12129,11775,11493,12470,20792,22337,21325,18581,16475,16581,15745,14453,13712,13766,13336,15346,24446,26178,24628,21282,18850,18822,18060,17536,16417,15842,15188,16905,25430,27962,26607,23364,20827,20506,19181,18016,17354,16256,15770,17538,26899,28915,25247,22856,19980,19856,16994,16839,15618,15883,15513,17106,25272,26731,22891,19583,16939,16757,15435,14786,13680,13208,12707,14277,22436,23229,18241,16145,13994,14780,13100,12329,12463,11532,10784,13106,19491,20418,16094,14491,13067) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '0.3' > 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/1adtu1229380731.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/2uz1e1229380731.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 -2.061685e-01 3.807288e-02 -1.338882e-01 1.258107e-02 [6] -2.821876e-02 5.852612e-05 7.448454e-02 1.778408e-02 1.589577e-01 [11] -2.723525e-02 1.268811e-01 -2.187036e-01 2.060858e-02 9.276370e-02 [16] 5.540457e-02 -4.488617e-02 8.650860e-03 4.128631e-02 -4.670761e-02 [21] 1.240731e-01 4.386908e-02 -4.289228e-02 -4.206574e-03 -5.212905e-03 [26] -2.480304e-02 -1.931650e-02 -3.865868e-02 1.032193e-01 -3.981509e-03 [31] -3.157227e-02 -9.527776e-02 6.750446e-02 -1.632135e-01 2.682581e-02 [36] 7.528117e-02 6.690877e-02 5.105174e-02 -1.625521e-01 1.423827e-02 [41] -9.037869e-02 6.155040e-02 -1.022719e-01 6.745289e-02 -6.279969e-02 [46] 1.985392e-02 5.514324e-02 -1.193735e-01 -9.796578e-02 8.643076e-02 [51] 1.082690e-02 -8.850210e-02 -5.773649e-02 -8.268646e-03 1.252495e-02 [56] 6.200421e-02 -5.355557e-02 4.784704e-02 -1.228083e-01 -1.593238e-02 [61] 3.914841e-02 > (mypacf <- c(rpacf$acf)) [1] -0.206168482 -0.004629337 -0.132595651 -0.043956889 -0.035879186 [6] -0.032097890 0.067423121 0.042273733 0.181031799 0.071343320 [11] 0.170138447 -0.116428891 -0.039424509 0.129849236 0.061392017 [16] -0.054882520 -0.016913448 0.007995184 -0.045537691 0.099694503 [21] 0.150850200 -0.036205050 0.016850777 -0.025457349 -0.073588637 [26] -0.007535468 -0.051734941 0.022857950 -0.053638189 -0.070582807 [31] -0.155313162 0.038473507 -0.106155218 -0.098366789 0.053717891 [36] 0.099690372 0.087388425 -0.127629941 -0.016967173 -0.005255604 [41] 0.016757983 -0.076925149 -0.055410696 -0.035606003 -0.056846892 [46] 0.028587701 -0.025441844 -0.105356840 0.135752163 -0.014092685 [51] -0.070803915 -0.088699486 0.043052073 0.017010383 0.047065132 [56] -0.061451793 0.002669440 -0.043715974 -0.018605782 -0.015147624 > 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/3xtae1229380731.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/4hvsa1229380731.tab") > > system("convert tmp/1adtu1229380731.ps tmp/1adtu1229380731.png") > system("convert tmp/2uz1e1229380731.ps tmp/2uz1e1229380731.png") > > > proc.time() user system elapsed 1.552 0.550 1.649