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(11178.4,9516.4,12102.8,12989.0,11610.2,10205.5,11356.2,11307.1,12648.6,11947.2,11714.1,12192.5,11268.8,9097.4,12639.8,13040.1,11687.3,11191.7,11391.9,11793.1,13933.2,12778.1,11810.3,13698.4,11956.6,10723.8,13938.9,13979.8,13807.4,12973.9,12509.8,12934.1,14908.3,13772.1,13012.6,14049.9,11816.5,11593.2,14466.2,13615.9,14733.9,13880.7,13527.5,13584.0,16170.2,13260.6,14741.9,15486.5,13154.5,12621.2,15031.6,15452.4,15428,13105.9,14716.8,14180.0,16202.2,14392.4,15140.6,15960.1,14351.3,13230.2,15202.1,17157.3,16159.1,13405.7,17224.7,17338.4,17370.6,18817.8,16593.2,17979.5,17015.2) > par5 = '12' > par4 = '1' > par3 = '1' > 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/1i32d1228413165.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/2q1s31228413165.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.5580453792 -0.0843848875 0.3560774507 -0.2064664024 [6] -0.1020168868 0.2978973179 -0.2481070419 -0.0057060576 0.2184485258 [11] -0.1608030176 -0.0601190068 0.1608726805 -0.1362501744 0.0169409101 [16] 0.1231971446 -0.2310877442 0.1432958462 0.0494393398 -0.1358806999 [21] 0.1127922964 0.0222179506 -0.2034495205 0.3593808595 -0.3114423718 [26] 0.0394010581 0.1459265603 -0.0505444263 -0.1217789688 0.1896792644 [31] -0.1551817743 -0.0003727142 0.1455176911 -0.1858863248 0.0588325680 [36] 0.0869225070 -0.1403524230 0.0483545031 0.0595713631 -0.1133203765 [41] 0.0826988297 0.0404794543 -0.1229041398 0.0826350089 0.0583736134 [46] -0.1843005586 0.1902370033 -0.0765598466 -0.0542556843 0.1002450453 [51] -0.0099352101 -0.1024549782 0.1210104296 -0.0361289810 -0.0573982622 [56] 0.0888067422 -0.0693795218 0.0263026892 0.0037453491 -0.0047866211 > (mypacf <- c(rpacf$acf)) [1] -0.558045379 -0.574800974 -0.084249902 0.047911687 -0.107896578 [6] 0.108875800 -0.013951139 -0.105192622 0.019596111 0.105496687 [11] -0.008389972 -0.079643694 -0.130031921 -0.075306842 0.054561580 [16] -0.163495513 -0.102348229 -0.049174927 0.008244400 0.117191206 [21] 0.152044932 -0.114675583 0.247270827 -0.055746765 -0.045976574 [26] -0.130931558 0.071272486 0.013990864 -0.022159052 -0.107404932 [31] -0.100070583 -0.036768232 -0.124103972 0.056580201 -0.002804899 [36] -0.066609528 -0.086464495 -0.097928868 0.023849503 -0.040634556 [41] 0.009438055 -0.029646871 0.017979179 0.044294794 -0.066589744 [46] -0.108581190 -0.028948837 -0.045772452 -0.054823120 -0.026215436 [51] 0.096290439 0.006549399 0.032258136 0.003513947 0.044981742 [56] 0.012282720 0.046946050 -0.001422239 -0.008630214 > 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/3yzw71228413165.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/44wag1228413165.tab") > > system("convert tmp/1i32d1228413165.ps tmp/1i32d1228413165.png") > system("convert tmp/2q1s31228413165.ps tmp/2q1s31228413165.png") > > > proc.time() user system elapsed 0.584 0.316 0.791