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(94,118.6,135,132.7,110.1,111,159.4,129.9,124.8,140.5,120.6,121.6,107.3,130.7,134.9,128.3,99.8,96.7,134.1,131.6,118,133.2,109.3,111.9,98.3,116.3,113.6,121.3,93.7,92.3,132,114.3,123.1,117.3,106,107.5,104.3,112.6,113.9,132.8,88.8,97.7,131.2,116.1,124.7,128.2,105,102.3,98.4,111.1,125.3,123.6,86.7,100.6,123.3,112.2,120.8,114.8,107.3,107.5,93.1,112.4,127.9,120.7,91,98.5,118.9,113.8,113.8,118.7,105.1,101.4,84.1,107.2,119.9,105.4,88.6,90.5,108.5,104.7,100,113.1,96.7,98.5) > 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/1vqzs1228842717.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/281vv1228842717.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.269960730 -0.098480493 0.060042975 0.175555625 [6] 0.292125684 0.224543725 0.246006085 0.092069245 -0.069846066 [11] -0.201601199 0.146998756 0.631944311 0.084343804 -0.194547959 [16] -0.114834420 -0.014605631 0.126112148 0.107047913 0.083964734 [21] -0.016522135 -0.141402429 -0.253144939 0.079427691 0.443929502 [26] 0.031151955 -0.142051776 -0.144326582 -0.038089706 0.074666048 [31] 0.087946083 0.076466341 -0.015354504 -0.118556335 -0.222905794 [36] 0.060039665 0.330982803 0.020718211 -0.139682378 -0.105460584 [41] -0.029958586 0.024892961 0.038131145 0.052697019 0.001467834 [46] -0.132394822 -0.196736722 0.028710878 0.230143362 0.002180855 [51] -0.134603379 -0.117067973 -0.025163391 0.001876959 -0.028855448 [56] 0.006765575 -0.020847873 -0.136143067 -0.189490660 -0.050320011 [61] 0.103368479 > (mypacf <- c(rpacf$acf)) [1] 0.269960730 -0.184829435 0.157953593 0.101681173 0.267303364 [6] 0.120162771 0.273685324 -0.037722466 -0.095319303 -0.403633537 [11] 0.134465815 0.516508508 -0.167227321 -0.021173082 -0.200066936 [16] -0.133202286 -0.062242054 0.035658050 -0.050148436 0.117498836 [21] 0.086152136 0.021663421 0.015965581 0.027483445 -0.057470873 [26] 0.091159491 -0.080971566 0.044666674 -0.143320631 0.023186679 [31] -0.023738622 0.057221770 0.025622338 0.048847487 -0.052508655 [36] 0.015043478 -0.073006634 -0.120303839 0.131577905 0.012875242 [41] 0.031635057 -0.060907220 -0.004084595 -0.029309337 -0.021356647 [46] 0.021605009 -0.024977826 0.016852800 0.009741673 -0.025672630 [51] -0.109196241 0.055524672 0.025253799 -0.065297830 0.016628256 [56] -0.098511041 -0.016316407 -0.002555387 -0.091090735 -0.051991517 > 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/3cpiy1228842717.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/4rxgs1228842717.tab") > > system("convert tmp/1vqzs1228842717.ps tmp/1vqzs1228842717.png") > system("convert tmp/281vv1228842717.ps tmp/281vv1228842717.png") > > > proc.time() user system elapsed 0.587 0.338 0.807