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(80,54.9,65.1,72.5,70.6,81.9,72,70.9,71.1,65.1,78.1,92,77.8,63.3,56.2,79.2,69,66.1,77.5,69.3,70.2,70.2,78.2,85.4,82.4,61.2,52.2,85.3,79.9,72.2,85.7,75.5,69.2,77.6,85.3,77,89.9,60,54.3,84,69.9,75.1,81.7,69.9,68.3,77.3,77.4,85.3,91,60.6,57.6,93.8,78.7,80.3,89.8,77.5,71.7,83.2,86.2,100.7,100.8,57.1,62.5,79.7,80.3,92.4,91.8,85.8,84.2,93.1,101.2,100.6,106.7,64,67.5,101,95.5,97,103.8,95.2,86.7,93.5,102.5,112.3,105.5,75.4,70.4,108,100,93.3,111.1,101.1,98.1) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '-1.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/17n351229626803.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/2ondm1229626803.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.403903766 0.040134971 0.157674707 0.093487785 [6] 0.269526561 0.412503142 0.254128881 0.128447017 0.113726492 [11] -0.024415275 0.304710441 0.740503288 0.293648220 -0.063336920 [16] 0.036353091 0.016506627 0.140741234 0.278631272 0.124254638 [21] 0.024780157 0.013293199 -0.109257364 0.200814362 0.518924720 [26] 0.150547060 -0.149816373 -0.108469572 -0.084146545 0.006193162 [31] 0.113928613 0.026300182 -0.060471180 -0.084143074 -0.167849619 [36] 0.063706083 0.337951703 0.052729395 -0.187982217 -0.141316478 [41] -0.128866354 -0.063939721 0.012223371 -0.055908303 -0.116081303 [46] -0.136555522 -0.198965868 -0.005731139 0.179685274 -0.025885403 [51] -0.231193861 -0.191191012 -0.161875265 -0.119776110 -0.051469255 [56] -0.075203918 -0.129632992 -0.136033350 -0.187282917 -0.058611083 [61] 0.097584720 > (mypacf <- c(rpacf$acf)) [1] 0.403903766 -0.146981603 0.242369356 -0.094284351 0.382216436 [6] 0.143671981 0.120502711 -0.023077445 0.047181704 -0.231348786 [11] 0.483961145 0.476063932 -0.230978174 -0.312080510 -0.009367466 [16] 0.016201223 -0.140318920 -0.126372084 -0.052448039 -0.033836179 [21] 0.059508593 0.027427814 0.107371855 -0.099301869 0.009328574 [26] -0.004088121 -0.076176009 -0.080089684 -0.105620456 -0.053177629 [31] 0.069483192 0.014245292 0.008501107 -0.007307109 -0.054078960 [36] 0.074706941 0.033500861 0.087193780 0.002488630 -0.025210937 [41] -0.042502780 -0.015570124 -0.099085705 -0.082169429 -0.042157867 [46] -0.025413317 0.017843911 -0.088948295 0.030798341 -0.041764509 [51] 0.032200707 -0.014943969 0.055923211 -0.046952122 0.107269533 [56] -0.047913870 0.086900272 -0.091012875 -0.026254558 -0.068391768 > 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/3z8xj1229626803.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/4dfv61229626803.tab") > > system("convert tmp/17n351229626803.ps tmp/17n351229626803.png") > system("convert tmp/2ondm1229626803.ps tmp/2ondm1229626803.png") > > > proc.time() user system elapsed 0.579 0.309 1.383