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(93.0,99.2,112.2,112.1,103.3,108.2,90.4,72.8,111.0,117.9,111.3,110.5,94.8,100.4,132.1,114.6,101.9,130.2,84.0,86.4,122.3,120.9,110.2,112.6,102.0,105.0,130.5,115.5,103.7,130.9,89.1,93.8,123.8,111.9,118.3,116.9,103.6,116.6,141.3,107.0,125.2,136.4,91.6,95.3,132.3,130.6,131.9,118.6,114.3,111.3,126.5,112.1,119.3,142.4,101.1,97.4,129.1,136.9,129.8,123.9) > par5 = '12' > par4 = '1' > 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/1napv1229878495.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/2w72n1229878495.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.0000000000 -0.1477284101 -0.0460905144 0.2339154800 -0.2078683500 [6] -0.0706955399 0.1591936804 -0.0792123754 0.0541693914 -0.0932836543 [11] -0.0509274088 0.0618358334 -0.2967252094 -0.0916490393 0.0111841783 [16] -0.0914102641 -0.0864199508 0.2239691071 -0.1126731037 -0.1411411276 [21] 0.0637926893 0.1371214295 -0.1744443777 0.2183867491 0.0368076408 [26] -0.0420921136 0.1396363543 0.0261051834 0.0549556703 0.0569401071 [31] -0.0797519273 0.0895575596 0.0058204659 -0.1680809122 0.1445404216 [36] -0.1013667574 -0.1060515674 0.0587168528 -0.0475302834 -0.0520972072 [41] 0.0930673998 -0.0627164213 -0.0254377361 0.0230899650 -0.0317787920 [46] 0.0110467741 0.0042538024 -0.0009336923 > (mypacf <- c(rpacf$acf)) [1] -0.147728410 -0.069429403 0.222276140 -0.154823236 -0.108006093 [6] 0.086444591 0.025963141 0.060304298 -0.183296959 -0.038546442 [11] 0.055214266 -0.274052602 -0.218737632 -0.124549024 0.057748724 [16] -0.185269206 0.092654688 -0.053902838 -0.154097094 -0.096239123 [21] 0.178821461 -0.149164224 0.064094331 -0.096041805 0.011704486 [26] 0.034982303 0.007417827 0.010383378 0.078723129 -0.008916419 [31] -0.023757172 -0.043205992 -0.003612484 -0.037465096 0.001091286 [36] -0.008371383 -0.004334596 -0.077373027 0.137504399 0.092664610 [41] 0.052813286 -0.080327307 0.099291506 -0.036786901 0.022178931 [46] -0.090027467 0.042486481 > 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/35ej61229878495.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/4u9gx1229878496.tab") > > system("convert tmp/1napv1229878495.ps tmp/1napv1229878495.png") > system("convert tmp/2w72n1229878495.ps tmp/2w72n1229878495.png") > > > proc.time() user system elapsed 0.592 0.330 0.769