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(1593,1477.9,1733.7,1569.7,1843.7,1950.3,1657.5,1772.1,1568.3,1809.8,1646.7,1808.5,1763.9,1625.5,1538.8,1342.4,1645.1,1619.9,1338.1,1505.5,1529.1,1511.9,1656.7,1694.4,1662.3,1588.7,1483.3,1585.6,1658.9,1584.4,1470.6,1618.7,1407.6,1473.9,1515.3,1485.4,1496.1,1493.5,1298.4,1375.3,1507.9,1455.3,1363.3,1392.8,1348.8,1880.3,1669.2,1543.6,1701.2,1516.5,1466.8,1484.1,1577.2,1684.5,1414.7,1674.5,1598.7,1739.1,1674.6,1671.8,1802,1526.8,1580.9,1634.8,1610.3,1712,1678.8,1708.1,1680.6,2056,1624,2021.4,1861.1,1750.8,1767.5,1710.3,2151.5,2047.9,1915.4,1984.7,1896.5,2170.8,2139.9,2330.5,2121.8,2226.8,1857.9,2155.9,2341.7,2290.2,2006.5,2111.9,1731.3,1762.2,1863.2,1943.5,1975.2) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '-0.9' > 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/1bgd41229085531.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/2earp1229085531.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.512476e-01 -8.634809e-02 2.770410e-01 -2.079957e-01 [6] 1.421387e-01 -1.249195e-01 4.183074e-02 1.356223e-02 -8.347115e-02 [11] -2.035485e-02 2.329059e-01 -3.262592e-01 -1.584420e-02 1.653462e-01 [16] -4.933276e-02 -3.739234e-03 -1.546542e-01 2.938337e-01 -1.740416e-01 [21] -3.000690e-03 1.630459e-01 -1.833891e-01 1.847610e-01 -1.119098e-01 [26] 2.258003e-02 1.616886e-01 -2.474340e-01 7.642309e-02 1.686375e-01 [31] -2.485884e-01 2.106918e-02 1.187945e-01 -7.908019e-02 -3.670837e-03 [36] 1.725539e-03 4.729105e-02 6.322934e-05 -8.511543e-02 4.767664e-02 [41] 2.136589e-02 -7.389129e-02 3.531245e-02 4.260515e-02 8.426901e-03 [46] -1.389505e-01 1.717982e-01 -3.858199e-02 -1.876840e-01 1.856984e-01 [51] -1.053898e-01 4.938675e-02 9.191924e-03 -4.004396e-02 3.972011e-02 [56] -2.660908e-04 -1.205614e-03 9.162274e-03 3.537156e-02 -1.159677e-01 [61] 1.563991e-01 > (mypacf <- c(rpacf$acf)) [1] -4.512476e-01 -3.641152e-01 8.625308e-02 -4.972996e-02 1.381378e-01 [6] -1.138954e-01 -8.422620e-06 -7.897448e-02 -4.432609e-02 -1.827902e-01 [11] 2.603128e-01 -2.216695e-01 -2.143600e-01 -2.493000e-01 1.833367e-01 [16] -1.113705e-02 -1.335601e-01 6.990672e-02 -1.581383e-04 -1.004099e-03 [21] 3.846860e-02 -1.052572e-01 2.475913e-01 -2.973241e-02 -1.248515e-01 [26] 7.112263e-02 6.695609e-02 -2.401970e-02 -3.034608e-02 -2.315222e-02 [31] -7.487806e-02 -2.369478e-02 1.046433e-01 -9.302056e-02 1.620276e-01 [36] 2.902549e-02 -1.614459e-02 -2.065910e-02 -5.346603e-02 -6.099096e-02 [41] -6.757587e-02 1.667649e-02 -3.626968e-02 -4.351246e-02 -2.349812e-02 [46] 4.988317e-02 -7.144143e-02 -1.387349e-01 -7.278294e-02 -3.292328e-02 [51] -1.751506e-02 -4.148197e-02 2.209031e-02 -2.729594e-02 -1.894550e-02 [56] 1.180347e-02 4.145465e-03 3.429624e-02 -6.961966e-02 -3.870260e-03 > 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/3grt71229085531.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/4k8fa1229085531.tab") > > system("convert tmp/1bgd41229085531.ps tmp/1bgd41229085531.png") > system("convert tmp/2earp1229085531.ps tmp/2earp1229085531.png") > > > proc.time() user system elapsed 0.600 0.317 0.705