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(17.8,17.9,17.4,16.7,16,16.6,19.1,17.8,17.2,18.6,16.3,15.1,19.2,17.7,19.1,18,17.5,17.8,21.1,17.2,19.4,19.8,17.6,16.2,19.5,19.9,20,17.3,18.9,18.6,21.4,18.6,19.8,20.8,19.6,17.7,19.8,22.2,20.7,17.9,20.9,21.2,21.4,23,21.3,23.9,22.4,18.3,22.8,22.3,17.8,16.4,16,16.4,17.7,16.6,16.2,18.3,17.6,15.1) > par7 = '' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '-1.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/18q3j1260545641.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/2qqk11260545641.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.5317911655 0.0525429429 0.3506596725 -0.3470528393 [6] 0.0872951199 0.2472855609 -0.4335636533 0.2698076847 -0.0931423388 [11] -0.1190593373 0.1556615273 -0.1051659663 -0.0458842369 0.1327381468 [16] -0.0041154735 -0.1748330804 0.1774462581 -0.0828867504 -0.0888943579 [21] 0.1961974204 -0.0983876024 -0.2245695534 0.4105779722 -0.3351603587 [26] 0.1277599833 0.1195366234 -0.1941742151 0.0864951516 0.0868170975 [31] -0.2087060388 0.1757916454 -0.1112013741 0.0158920858 0.0896335572 [36] -0.1427299577 0.0288814278 0.0551941297 -0.0693298232 0.0404414398 [41] 0.0229231351 -0.0612706329 0.0451134668 0.0061885159 -0.0060679674 [46] 0.0005005435 -0.0033943850 > (mypacf <- c(rpacf$acf)) [1] -0.531791166 -0.321053392 0.337087214 0.078976996 -0.139721883 [6] 0.157437472 -0.165476815 -0.097967722 -0.182081375 0.003445484 [11] 0.019274944 -0.032946882 -0.015182377 -0.017384197 0.253224885 [16] -0.226138835 -0.165556919 -0.036879662 -0.036271307 0.073329582 [21] 0.075424572 -0.232595220 0.063564498 0.017117959 0.072738893 [26] -0.065986393 0.069346875 -0.061096014 -0.166606026 0.017732242 [31] -0.027594356 -0.031691598 0.037236705 0.078749871 -0.094085355 [36] -0.105193515 -0.019798871 -0.091525737 0.033288023 -0.019982983 [41] 0.013846697 0.090602394 -0.035400220 -0.112098068 0.077538188 [46] -0.098164832 > 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/31l3d1260545641.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/4ubp21260545641.tab") > > system("convert tmp/18q3j1260545641.ps tmp/18q3j1260545641.png") > system("convert tmp/2qqk11260545641.ps tmp/2qqk11260545641.png") > > > proc.time() user system elapsed 0.603 0.308 1.406