R version 2.10.1 (2009-12-14) 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(237,236,235,233,231,230,231,233,234,234,235,237,246,245,240,239,231,224,229,231,238,240,237,239,248,239,237,232,216,209,214,217,217,227,218,220,229,224,216,208,191,190,196,196,200,204,193,194,207,209,193,175,157,150,162,157,160,167,159,161,179,180,169,152,128,125,131,135,141,154,152,147,163,165,147,130,106,107,115,114,124,141,139,129) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '2' > 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: > 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/13js01278093590.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/23js01278093590.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.000000e+00 8.424617e-01 7.896818e-01 6.972342e-01 5.982310e-01 [6] 5.459155e-01 4.437048e-01 3.685152e-01 2.966629e-01 1.574087e-01 [11] 9.346178e-02 2.551893e-02 -9.208156e-02 -5.499600e-02 -1.102490e-01 [16] -1.007895e-01 -1.180919e-01 -1.081031e-01 -2.491306e-02 7.809361e-03 [21] 2.880316e-02 8.061969e-02 3.572370e-02 4.071214e-02 7.393568e-03 [26] -4.897726e-03 1.865564e-02 -1.495453e-02 -2.355228e-02 -7.183943e-02 [31] -1.493941e-01 -2.048092e-01 -2.391645e-01 -2.831857e-01 -2.815884e-01 [36] -3.313660e-01 -3.074778e-01 -3.309685e-01 -3.375359e-01 -3.043491e-01 [41] -2.945439e-01 -2.622103e-01 -2.581074e-01 -2.368004e-01 -2.126639e-01 [46] -1.923829e-01 -1.576517e-01 -1.040424e-01 -9.255243e-02 -6.532713e-02 [51] -5.367518e-02 -4.947513e-02 -3.709960e-02 -3.788906e-02 -1.631207e-02 [56] -8.796466e-03 -6.032788e-03 9.104262e-04 4.773527e-04 -3.131952e-05 > (mypacf <- c(rpacf$acf)) [1] 0.8424617146 0.2754102379 -0.0627833045 -0.1283861991 0.0855308408 [6] -0.1210320536 -0.0665778026 -0.0079819225 -0.2778497499 0.0097226566 [11] 0.0976979376 -0.2698120579 0.3826247214 -0.0047249742 -0.0582261046 [16] 0.0004702902 0.2242217001 0.1476241382 0.0110693149 -0.1334158555 [21] -0.1088645889 -0.2377186173 -0.0245947270 -0.2958018359 0.1925888150 [26] 0.0310011526 0.0436272650 -0.0993870717 0.0609872438 0.0151673236 [31] -0.1009206979 0.0379105423 -0.0182349279 -0.0840494473 0.0202900555 [36] -0.1089093185 -0.0107720448 -0.0785797104 0.0781775630 -0.1411834857 [41] 0.0748486368 -0.0302508659 0.0642060961 -0.0080533997 0.0182703196 [46] -0.0422556917 0.0270819040 -0.0185177835 0.0351963167 0.0271453810 [51] 0.0697157083 -0.0775265510 0.0014079139 -0.1424412505 0.0370037882 [56] 0.0366905925 -0.0626521480 0.0323287789 0.0177893037 > 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/3htp91278093590.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/4sk7c1278093590.tab") > > try(system("convert tmp/13js01278093590.ps tmp/13js01278093590.png",intern=TRUE)) character(0) > try(system("convert tmp/23js01278093590.ps tmp/23js01278093590.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.590 0.370 0.634