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(2490,3266,3475,3127,2955,3870,2852,3142,3029,3180,2560,2733,2452,2553,2777,2520,2318,2873,2311,2395,2099,2268,2316,2181,2175,2627,2578,3090,2634,3225,2938,3174,3350,2588,2061,2691,2061,2918,2223,2651,2379,3146,2883,2768,3258,2839,2470,5072,1463,1600,2203,2013,2169,2640,2411,2528,2292,1988,1774,2279) > 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/1q1w91229874868.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/29zy81229874868.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.185147206 0.226796733 0.247831267 0.063747522 [6] -0.025631353 0.101915243 -0.136645923 -0.015660924 -0.105892148 [11] 0.005903308 -0.258938593 0.012846747 -0.108624343 -0.028781088 [16] 0.063342396 -0.012022755 -0.125050150 -0.005163067 -0.173652688 [21] -0.018159919 -0.111925634 -0.015227033 -0.048883990 0.034859448 [26] 0.006714430 0.008071517 -0.010385999 0.053807291 -0.035352819 [31] 0.115171337 -0.066779715 0.004225085 0.045936691 0.048569968 [36] 0.031941729 0.138708598 0.059188727 0.147927643 0.118313503 [41] 0.084177247 -0.011263992 0.137997750 -0.053667833 -0.059227632 [46] 0.004264348 -0.049725604 -0.172650262 -0.096928764 -0.107608583 [51] -0.098614060 -0.078846312 -0.076975829 -0.092891083 -0.072086186 [56] -0.067442166 -0.065982165 -0.039072112 -0.004729784 0.003084769 > (mypacf <- c(rpacf$acf)) [1] 0.185147206 0.199350892 0.191193884 -0.042227315 -0.127751998 [6] 0.076913745 -0.148429908 0.025543719 -0.099617565 0.102934223 [11] -0.262831478 0.112000259 -0.059228943 0.081725620 0.093682888 [16] -0.099858926 -0.085600490 -0.137404499 -0.051910099 0.019368605 [21] -0.012213102 0.008582118 0.003724334 0.027462104 0.013419714 [26] -0.006888586 -0.028903429 -0.024547404 -0.041476772 0.033445485 [31] -0.074611098 -0.004019903 0.086971744 0.077138489 0.037391527 [36] 0.071053734 0.021452935 0.045178648 0.046459317 -0.061922662 [41] -0.023429813 0.081863482 -0.063415651 -0.048529923 0.037086649 [46] 0.043079387 -0.081766495 -0.144431682 0.049790689 -0.031453539 [51] 0.010097379 -0.112367741 0.031434996 -0.101263076 0.013665951 [56] 0.009225711 0.010414361 0.024444739 -0.021999330 > 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/39u4m1229874868.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/4pzft1229874868.tab") > > system("convert tmp/1q1w91229874868.ps tmp/1q1w91229874868.png") > system("convert tmp/29zy81229874868.ps tmp/29zy81229874868.png") > > > proc.time() user system elapsed 0.601 0.323 0.726