R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(321.935,310.215,309.030,305.333,294.735,289.351,288.225,289.648,290.155,288.301,289.148,289.741,287.595,285.226,287.816,283.519,290.304,282.166,280.041,282.500,279.913,277.793,281.229,275.363,273.547,270.601,273.338,271.917,273.985,273.911,270.798,271.115,271.344,274.525,276.663,273.784,274.027,269.160,270.491,270.846,270.333,272.599,272.764,270.674,268.175,268.351,272.482,268.714,269.419,265.518,264.101,267.179,271.322,270.157,271.296,269.907,271.244,266.844,270.911,269.829,269.285,263.018,266.680,265.814,268.457,269.508,270.223,264.676,265.521,262.971,266.003,267.722,266.433) > 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/rcomp/tmp/1kmib1244113435.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/2mll31244113435.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.848026840 0.759002370 0.659750709 0.572154425 [6] 0.529723278 0.513946703 0.491801149 0.466062793 0.423067118 [11] 0.403451724 0.373239098 0.344044440 0.309927849 0.283711654 [16] 0.233985888 0.217012867 0.169131809 0.150543115 0.138922385 [21] 0.104299230 0.062567277 0.043799353 -0.003853995 -0.021444984 [26] -0.036484982 -0.038366289 -0.058266337 -0.070499944 -0.083309730 [31] -0.088641554 -0.086110235 -0.081234535 -0.091832501 -0.109527212 [36] -0.140297601 -0.151944823 -0.171697243 -0.166720880 -0.170482563 [41] -0.174151600 -0.185509279 -0.195748610 -0.213608979 -0.222023543 [46] -0.231603628 -0.235125266 -0.267535225 -0.272933166 -0.282234211 [51] -0.273497861 -0.249720270 -0.236045940 -0.247242792 -0.243341607 [56] -0.249710194 -0.248552979 -0.253155164 -0.245459353 -0.251750535 [61] -0.254646649 > (mypacf <- c(rpacf$acf)) [1] 0.848026840 0.141900586 -0.046891217 -0.022459502 0.122229276 [6] 0.129244714 0.008285938 -0.021373826 -0.048711737 0.084238220 [11] 0.001096347 -0.032139488 -0.052416694 0.015606187 -0.077088721 [16] 0.051411199 -0.104860473 0.027446597 0.039152981 -0.083342648 [21] -0.095214805 0.043574029 -0.067283791 0.012883374 0.004211828 [26] 0.018993422 -0.051653418 0.002263037 0.009711446 0.010533289 [31] 0.057104787 -0.021147169 -0.040601951 -0.040853372 -0.054447569 [36] 0.023988006 -0.026884773 -0.007740773 -0.009741295 -0.023296810 [41] -0.039000330 -0.017683363 -0.029097130 -0.032752201 -0.020597844 [46] -0.006990142 -0.125974613 0.021592462 0.017779912 0.017517727 [51] 0.052505780 -0.038447460 -0.079235602 0.052119440 0.013895841 [56] -0.020639276 -0.053018201 -0.010040368 -0.028163909 -0.019858970 > 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/3ur4y1244113435.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/4kyxo1244113435.tab") > > system("convert tmp/1kmib1244113435.ps tmp/1kmib1244113435.png") > system("convert tmp/2mll31244113435.ps tmp/2mll31244113435.png") > > > proc.time() user system elapsed 0.612 0.335 0.811