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(12.5,14.8,15.9,14.8,12.9,14.3,14.2,15.9,15.3,15.5,15.1,15,12.1,15.8,16.9,15.1,13.7,14.8,14.7,16,15.4,15,15.5,15.1,11.7,16.3,16.7,15,14.9,14.6,15.3,17.9,16.4,15.4,17.9,15.9,13.9,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,21.2,21.4,21.7,23.2,21.5,22.9,23.2,18.6) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '0.0' > 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/1gwnk1228918485.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/20ufx1228918485.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.687963968 0.574227533 0.637208781 0.645273026 [6] 0.574151816 0.615473970 0.489425099 0.544816806 0.477586083 [11] 0.363593347 0.442856104 0.629630902 0.382394406 0.305514338 [16] 0.332152695 0.348868546 0.321250474 0.325443828 0.232998174 [21] 0.286505164 0.211262048 0.108260179 0.198715699 0.298723035 [26] 0.123221897 0.071169982 0.051889384 0.072287710 0.056185536 [31] 0.021816776 -0.034630772 0.007016599 -0.079804984 -0.147172325 [36] -0.075684022 -0.002507404 -0.119477810 -0.164543686 -0.181621141 [41] -0.136853294 -0.173490011 -0.192755008 -0.221780312 -0.176526470 [46] -0.251797905 -0.286659210 -0.256553011 -0.188508186 -0.268457002 [51] -0.313432156 -0.327956378 -0.264135483 -0.312000727 -0.318698811 [56] -0.330909383 -0.282771245 -0.318966995 -0.338093683 -0.314101139 [61] -0.237166035 > (mypacf <- c(rpacf$acf)) [1] 0.6879639678 0.1916309917 0.3666583468 0.2060275889 0.0494372797 [6] 0.2138304115 -0.2440332156 0.2458109067 -0.2679773636 -0.1440907025 [11] 0.2631035055 0.3683617631 -0.3474700451 -0.1270418872 -0.0958241909 [16] 0.0287172000 0.0254692034 -0.0085328505 0.1013947425 -0.1055706312 [21] -0.0229442822 -0.0713185903 0.0789928673 -0.0937952305 0.0197682148 [26] -0.0086615099 -0.1400684115 0.0178249900 -0.1303150652 0.0315149557 [31] -0.0244655388 -0.0041888400 -0.0027894467 -0.0122296723 -0.0393239353 [36] 0.0759219691 -0.0557683510 -0.0220187672 0.0254523489 -0.0162841972 [41] -0.1252235770 0.0299531650 -0.0401852255 0.0500088764 0.0003084900 [46] 0.0056749524 -0.0772438780 -0.0512870224 -0.0144381368 -0.0246235490 [51] -0.0094169353 0.0142559648 0.0212065095 -0.0618430184 -0.0036130799 [56] 0.0083998717 0.0749310359 -0.0342318018 0.0782976139 -0.0405780385 > 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/3aaj81228918485.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/4la0s1228918485.tab") > > system("convert tmp/1gwnk1228918485.ps tmp/1gwnk1228918485.png") > system("convert tmp/20ufx1228918485.ps tmp/20ufx1228918485.png") > > > proc.time() user system elapsed 0.595 0.316 0.714