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(632,1270,1211,1469,2570,2765,2487,3644,2501,1629,987,1100,690,1378,1376,1736,2800,2671,2508,3590,2691,1629,1020,1224,787,1424,1232,2021,2782,2682,3284,3194,2736,1701,1089,1240,799,1163,1180,1960,2914,2658,3254,3222,2987,1604,1032,1283,774,1109,1453,1849,2800,3310,3060,3422,3448,1670,1022,1391,767,1172,1498,1623,2646,3439) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '0.2' > 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/freestat/rcomp/tmp/12u431228918899.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/freestat/rcomp/tmp/21iam1228918899.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.142278245 -0.083073680 0.307889270 -0.182020069 [6] -0.041036954 0.257025276 -0.208597348 -0.086354090 0.156606812 [11] -0.064946790 -0.037587164 0.079272612 -0.183333539 0.043337306 [16] 0.058246750 -0.119450729 0.073196348 -0.039976662 -0.161546350 [21] 0.199489135 -0.055801954 -0.225725435 0.169929921 -0.204274552 [26] -0.060517519 0.251507555 -0.047038673 -0.024890847 0.085492813 [31] -0.057590346 -0.053641085 0.086109504 -0.094606842 -0.075078667 [36] 0.051847046 -0.071516344 0.026568586 0.060144678 -0.039049874 [41] -0.022908481 0.062351330 0.026324588 0.009739974 0.018954968 [46] 0.017726030 0.027817981 -0.004362084 -0.065833285 -0.056282237 [51] -0.031634800 -0.023063899 -0.007316696 0.001756756 > (mypacf <- c(rpacf$acf)) [1] -0.142278245 -0.105451443 0.288812912 -0.120338918 -0.035977289 [6] 0.164464150 -0.104344174 -0.111561306 0.017438421 0.084964399 [11] -0.019774174 -0.042678181 -0.131548718 0.066768400 -0.015589071 [16] -0.052382938 0.047315400 -0.054918535 -0.113004947 0.107357753 [21] -0.018611314 -0.174645288 0.023709609 -0.175487346 0.041183311 [26] 0.076964152 0.129455648 0.067413737 -0.131885094 -0.012073621 [31] -0.064249863 -0.019893567 -0.041699377 -0.020180348 -0.063488173 [36] -0.044631129 -0.005210811 0.058581825 0.094592271 -0.122478526 [41] 0.017651278 0.090744069 -0.031668455 0.006384705 0.078118961 [46] -0.045201517 -0.063438334 -0.146202203 -0.029664079 0.063925416 [51] -0.039814320 -0.012041741 -0.062461350 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3ui481228918899.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/freestat/rcomp/tmp/46zbt1228918899.tab") > > system("convert tmp/12u431228918899.ps tmp/12u431228918899.png") > system("convert tmp/21iam1228918899.ps tmp/21iam1228918899.png") > > > proc.time() user system elapsed 0.813 0.417 0.928