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(517,540,454,292,445,483,545,355,370,372,422,445,471,413,307,308,389,377,521,420,413,384,466,434,263,334,334,416,309,334,350,337,277,439,433,455,372,409,471,382,417,405,410,357,360,329,359,393,448,593,535,449,742,631,513,526,677,631,547,533,433,427,470,418,485,464,439,452,423,537,384,380) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/1cj1i1244396168.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/2zs571244396168.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.566718203 0.362598150 0.346861060 0.413315597 [6] 0.313851941 0.209627998 0.181222088 0.071837729 -0.012717238 [11] 0.020098496 0.041234879 0.068970457 -0.016284017 -0.016032279 [16] 0.063255593 0.080853822 0.112549147 -0.021028836 -0.045878521 [21] -0.113157590 -0.088472413 -0.084925681 -0.157594944 -0.264635564 [26] -0.230792307 -0.232268085 -0.210448117 -0.249649992 -0.117787887 [31] -0.120350796 -0.117428156 -0.151357922 -0.138089433 -0.046521219 [36] -0.119050381 -0.078711545 -0.106452609 -0.109783656 -0.099743838 [41] -0.092049812 -0.125745301 -0.124344632 -0.115472829 -0.082450695 [46] -0.116297430 -0.007564017 0.015313382 -0.013137781 > (mypacf <- c(rpacf$acf)) [1] 0.566718203 0.061029418 0.176436829 0.220372964 -0.038311283 [6] -0.033316636 0.002856632 -0.181576728 -0.095397135 0.064501026 [11] 0.015846545 0.137385067 -0.044253807 0.011352650 0.110233871 [16] -0.021208626 0.079641546 -0.209305068 -0.084426605 -0.158816661 [21] -0.023254821 0.006663433 -0.059234452 -0.115569837 0.110295659 [26] -0.073576205 0.009064432 -0.054320380 0.127403406 0.008977681 [31] 0.012363601 -0.153387207 -0.113737062 0.059442622 -0.101398556 [36] 0.125430228 -0.072619365 -0.004752293 0.085454659 0.011448029 [41] -0.108366213 -0.007168428 -0.047661543 -0.044096300 -0.034837870 [46] 0.019725419 0.077043843 -0.066051019 > 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/3li871244396168.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/43jm01244396168.tab") > > system("convert tmp/1cj1i1244396168.ps tmp/1cj1i1244396168.png") > system("convert tmp/2zs571244396168.ps tmp/2zs571244396168.png") > > > proc.time() user system elapsed 0.582 0.319 0.699