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(2236,2084.9,2409.5,2199.3,2203.5,2254.1,1975.8,1742.2,2520.6,2438.1,2126.3,2267.5,2201.1,2128.5,2596,2458.2,2210.5,2621.2,2231.4,2103.6,2685.8,2539.3,2462.4,2693.3,2307.7,2385.9,2737.6,2653.9,2545.4,2848.8,2359.5,2488.3,2861.1,2717.9,2844,2749,2652.9,2660.2,3187.1,2774.1,3158.2,3244.6,2665.5,2820.8,2983.4,3077.4,3024.8,2731.8,3046.2,2834.8,3292.8,2946.1,3196.9,3284.2,3003,2979,3137.4,3630.2,3270.7,2942.3) > par5 = '12' > par4 = '0' > par3 = '1' > 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/1t7ot1229088769.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/2puxv1229088769.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.000000000 -0.405250557 -0.255220020 0.303436387 -0.232514552 [6] -0.065470258 0.370376431 -0.146116598 -0.197187075 0.361023546 [11] -0.369325817 -0.135042735 0.584373378 -0.296953989 -0.068307766 [16] 0.167599603 -0.252799674 0.064565713 0.238504877 -0.132537246 [21] -0.054526777 0.193262276 -0.359220116 0.118585472 0.216502867 [26] -0.132287279 0.002816472 0.023138412 -0.124593187 0.032985683 [31] 0.144719657 -0.101324213 0.048884253 0.012520310 -0.150365880 [36] 0.019444152 0.153544565 -0.037541569 -0.031341887 -0.043354830 [41] 0.024527902 -0.020035133 0.048733892 -0.004168856 0.015083223 [46] -0.025815151 -0.011637686 -0.072751305 0.095890039 > (mypacf <- c(rpacf$acf)) [1] -0.4052505567 -0.5018689793 -0.0884133444 -0.3417591636 -0.3944226154 [6] -0.0371211821 0.0642353008 -0.0770658281 0.3183898265 -0.0792339724 [11] -0.4010714588 0.0470343822 -0.0366063206 0.0999837573 -0.0126692569 [16] -0.0687290034 0.0956837783 -0.0654952738 0.0949223863 0.1512866909 [21] 0.0614529084 -0.0894815967 0.0556042096 -0.1597604820 0.0471410223 [26] -0.1179699740 -0.0638612147 0.1078949099 -0.0555585815 0.0360204800 [31] -0.0002478281 -0.0798520785 -0.0615876584 0.0249742031 -0.2351853063 [36] 0.0460036066 -0.1171531081 -0.0510077441 -0.1044554193 -0.0149324631 [41] 0.1214868722 0.0098004152 -0.0346426106 0.0540588152 -0.0608266331 [46] -0.0294097008 0.0008033859 -0.1076027411 > 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/31dag1229088769.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/4o5q81229088769.tab") > > system("convert tmp/1t7ot1229088769.ps tmp/1t7ot1229088769.png") > system("convert tmp/2puxv1229088769.ps tmp/2puxv1229088769.png") > > > proc.time() user system elapsed 0.555 0.314 0.682