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(3230.66,3361.13,3484.74,3411.13,3288.18,3280.37,3173.95,3165.26,3092.71,3053.05,3181.96,2999.93,3249.57,3210.52,3030.29,2803.47,2767.63,2882.6,2863.36,2897.06,3012.61,3142.95,3032.93,3045.78,3110.52,3013.24,2987.1,2995.55,2833.18,2848.96,2794.83,2845.26,2915.02,2892.63,2604.42,2641.65,2659.81,2638.53,2720.25,2745.88,2735.7,2811.7,2799.43,2555.28,2304.98,2214.95,2065.81,1940.49,2042,1995.37,1946.81,1765.9,1635.25,1833.42,1910.43,1959.67,1969.6,2061.41,2093.48,2120.88,2174.56,2196.72,2350.44,2440.25,2408.64,2472.81,2407.6,2454.62,2448.05,2497.84,2645.64,2756.76,2849.27,2921.44,2981.85,3080.58,3106.22,3119.31,3061.26,3097.31,3161.69,3257.16,3277.01,3295.32,3363.99,3494.17,3667.03,3813.06,3917.96,3895.51,3801.06,3570.12,3701.61,3862.27,3970.1,4138.52,4199.75,4290.89,4443.91,4502.64,4356.98,4591.27,4696.96,4621.4,4562.84,4202.52,4296.49,4435.23,4105.18,4116.68,3844.49,3720.98,3674.4,3857.62,3801.06,3504.37,3032.6,3047.03,2962.34,2197.82,2014.45) > par5 = '12' > par4 = '0' > par3 = '0' > 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/freestat/rcomp/tmp/1hhfz1228934902.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/2cboy1228934902.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.00000000 0.97023550 0.93301855 0.90672964 0.87490279 0.83807857 [7] 0.80303842 0.77149258 0.73872959 0.69746885 0.65241988 0.60795536 [13] 0.56099946 0.51132994 0.47064876 0.42353736 0.37307075 0.32809013 [19] 0.28476206 0.24667400 0.20526649 0.16116449 0.12157724 0.08428644 [25] 0.04839867 0.01495235 -0.01861083 -0.05237375 -0.08507833 -0.12033757 [31] -0.15743317 -0.18977065 -0.21806626 -0.24402299 -0.26812280 -0.28962755 [37] -0.30949261 -0.33121737 -0.35220297 -0.37173653 -0.39106368 -0.41059049 [43] -0.42994888 -0.44600139 -0.45599134 -0.46336376 -0.46742201 -0.46898499 [49] -0.46773505 -0.46478101 -0.45771155 -0.44826795 -0.43720961 -0.42287217 [55] -0.40848062 -0.39235752 -0.37229754 -0.35114625 -0.32661472 -0.30124012 [61] -0.27696498 > (mypacf <- c(rpacf$acf)) [1] 9.702355e-01 -1.421885e-01 1.866152e-01 -1.700451e-01 -2.542398e-02 [6] -2.249075e-02 3.351815e-02 -4.029098e-02 -1.487927e-01 -6.888093e-02 [11] -5.706647e-02 -5.961104e-02 -4.748017e-02 1.314121e-01 -2.301278e-01 [16] 4.125019e-02 -2.458090e-02 1.297524e-02 1.132364e-01 -1.394094e-01 [21] -7.347789e-03 -4.800202e-02 3.176268e-02 3.366504e-02 -7.417320e-04 [26] -8.877747e-02 -1.512037e-02 -9.304510e-02 -4.359963e-02 -3.061455e-02 [31] -1.704252e-02 5.853768e-02 -8.448875e-02 3.389307e-02 1.689582e-02 [36] -2.849452e-02 -2.814259e-02 -2.434523e-02 -6.605333e-02 -1.417354e-03 [41] -5.559950e-02 -5.938674e-02 1.781129e-02 3.170671e-02 2.594445e-02 [46] 2.152790e-02 -2.055765e-02 5.464803e-02 -7.444646e-03 8.007595e-02 [51] 9.752081e-06 -1.202895e-02 3.386265e-02 -6.833963e-02 3.735244e-02 [56] 4.929537e-02 8.551444e-04 3.206175e-02 -3.818442e-02 -5.753093e-02 > 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/3pqqh1228934902.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/4gf6t1228934902.tab") > > system("convert tmp/1hhfz1228934902.ps tmp/1hhfz1228934902.png") > system("convert tmp/2cboy1228934902.ps tmp/2cboy1228934902.png") > > > proc.time() user system elapsed 0.802 0.415 0.888