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(93.4,98.5,100.8,102.3,104.7,101.1,101.4,99.5,98.4,96.3,100.7,101.2,100.3,97.8,97.4,98.6,99.7,99,98.1,97,98.5,103.8,114.4,124.5,134.2,131.8,125.6,119.9,114.9,115.5,112.5,111.4,115.3,110.8,103.7,111.1,113,111.2,117.6,121.7,127.3,129.8,137.1,141.4,137.4,130.7,117.2,110.8,111.4,108.2,108.8,110.2,109.5,109.5,116,111.2,112.1,114,119.1,114.1,115.1,115.4,110.8,116,119.2,126.5,127.8,131.3,140.3,137.3,143,134.5,139.9,159.3,170.4,175,175.8,180.9,180.3,169.6,172.3,184.8,177.7,184.6,211.4,215.3,215.9,244.7,259.3,289,310.9,321,315.1,333.2,314.1,284.7) > 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/1shva1228942411.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/28iau1228942411.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.952907403 0.884781103 0.804353703 0.724824959 [6] 0.641001971 0.563864062 0.496225603 0.442197218 0.396736822 [11] 0.362001023 0.328504087 0.299333781 0.280601981 0.262726622 [16] 0.240465846 0.220879348 0.197327091 0.166348131 0.134307836 [21] 0.102150197 0.068643787 0.038206085 0.016222557 0.003233294 [26] -0.006203077 -0.020158067 -0.032879551 -0.046304746 -0.055097674 [31] -0.061178729 -0.067360804 -0.069946650 -0.071021002 -0.072842395 [36] -0.077900286 -0.082481720 -0.086700333 -0.092446999 -0.093464427 [41] -0.092642980 -0.089000980 -0.085799470 -0.077967575 -0.067728695 [46] -0.056910826 -0.047014738 -0.040099703 -0.035334976 > (mypacf <- c(rpacf$acf)) [1] 0.9529074032 -0.2528221507 -0.1278057771 0.0122881427 -0.0990728149 [6] 0.0389924138 0.0426580693 0.0547690566 0.0009111049 0.0378695924 [11] -0.0646832245 0.0056682964 0.1030695366 -0.0600824785 -0.0612909004 [16] 0.0581720071 -0.0809316442 -0.0909148037 0.0429233300 -0.0224628614 [21] -0.0480956859 0.0433456999 0.0391886931 0.0161279895 -0.0007218645 [26] -0.1189073555 -0.0061752900 0.0132466130 0.0273871165 0.0036459187 [31] 0.0006522913 0.0337804385 -0.0462442365 -0.0136222942 -0.0232611357 [36] 0.0208203840 0.0019504121 -0.0430266742 0.0679170943 -0.0168816942 [41] -0.0037831674 -0.0089290378 0.0461164999 0.0191291659 -0.0039002470 [46] -0.0013786248 -0.0414125018 0.0024962150 > 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/3r9bd1228942411.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/4q4cl1228942411.tab") > > system("convert tmp/1shva1228942411.ps tmp/1shva1228942411.png") > system("convert tmp/28iau1228942411.ps tmp/28iau1228942411.png") > > > proc.time() user system elapsed 0.598 0.319 0.716