R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(97,100.7,101.4,101.5,101.8,101.5,102.2,101.8,98.5,98.4,97.5,97.7,98.3,99.6,99.4,96.7,96.9,96.1,97.9,99.2,97.8,94.9,93.3,91.5,89.1,92.3,91.8,92.1,94.4,92.8,92.6,92.3,92.1,89.8,87.4,87.7,86.3,89.1,90.4,87.1,86.7,84.4,88.4,88.9,88.5,87.2,86.2,83.4,87.5,85.7,87.4,86.8,87.9,85.9,87.7,87,86.8,86.2,86.1,87.5,85.7,88.9,89.8,91.4,95.2,94.1,96.8,96.1,96.6,94.2,93.9,96.5,93.4,95,95.2,94,97,96.9,96.3,96.3,97.3,95.7,96.4,95.1,94.6,95.9,96.2,94.3,98.3,95.9,92.1,94.6,94.7,96.7,97.5,96.2,97.1,95.9,94.5,99.4,101.3,101.4,100.9,101.4,103.1,102.4,101.1,102,103.9,101.7,101.2,101.9,101.1,103.1,103.3,101.4,102.8,103,102.6,102.2) > par7 = '0.95' > par6 = 'White Noise' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/rcomp/tmp/1tcjf1290010650.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/2tcjf1290010650.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.9382907400 0.8946388094 0.8512552811 0.8036248647 [6] 0.7796963165 0.7454966607 0.7026111882 0.6672932131 0.6304217408 [11] 0.5969783237 0.5701996865 0.5417865062 0.4912577423 0.4448854528 [16] 0.3926129965 0.3380610368 0.2936440673 0.2435392684 0.1955014936 [21] 0.1516440386 0.1120229685 0.0966989071 0.0823397315 0.0599886678 [26] 0.0358416790 0.0004994327 -0.0399685738 -0.0606274681 -0.0834832587 [31] -0.1020555415 -0.1199215473 -0.1451879909 -0.1566584708 -0.1653447203 [36] -0.1791587170 -0.1790927236 -0.1967928053 -0.2237526957 -0.2542147323 [41] -0.2806226309 -0.3047814004 -0.3236491955 -0.3375313219 -0.3589778230 [46] -0.3591130957 -0.3688008506 -0.3779310781 -0.3716248374 > (mypacf <- c(rpacf$acf)) [1] 0.9382907400 0.1191308299 0.0003966036 -0.0556769288 0.1656230929 [6] -0.0495763566 -0.1076366143 0.0103005834 0.0165861440 -0.0095712188 [11] 0.0144676472 0.0080837479 -0.2089473998 -0.0505042038 -0.0642192902 [16] -0.0733522657 -0.0336694508 -0.0410007809 -0.0181160528 -0.0240455009 [21] 0.0375794434 0.1830035189 0.0345282748 -0.0715001391 -0.0136915242 [26] -0.0688549233 -0.1146743937 0.0978151774 0.0143689898 0.0056728409 [31] -0.0214567088 -0.0132835243 0.0495184402 -0.0718614462 -0.0838243091 [36] 0.0718229799 -0.1427347382 -0.1288697244 -0.0890094991 -0.0032753277 [41] -0.0464758350 -0.0033193990 0.0955324854 -0.0555666291 0.0831465505 [46] -0.0623098250 -0.0536024385 0.0186565687 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3p4h61290010650.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/rcomp/tmp/4smft1290010650.tab") > > try(system("convert tmp/1tcjf1290010650.ps tmp/1tcjf1290010650.png",intern=TRUE)) character(0) > try(system("convert tmp/2tcjf1290010650.ps tmp/2tcjf1290010650.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.770 0.290 1.056