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(699.8,871.2,842.6,809.2,847.1,857,839.9,967.4,1037.2,1062.3,899.3,1129.6,845.7,1173.9,1073.8,1024.7,912.9,1055,936.4,920.6,1059.3,1164.1,823.9,1076.6,833.5,996,852.8,758.5,760.4,826.8,941.7,1097.8,802.8,839.7,791,1063.1,1138.4,888.6,931.1,863.2,936.2,701.7,873.8,696.8,658.1,706.7,458.5,685.7,660.1,774.9,787.4,486.9,310.8,619.5,550.2,463.4,630.4,729,485.6,453.7) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/html/rcomp/tmp/1356x1259310958.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/html/rcomp/tmp/2qh941259310958.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.512660361 0.351832528 0.298273463 0.357632681 [6] 0.254357399 0.106149208 0.011302149 0.015834092 -0.022247871 [11] -0.135085111 -0.126972624 -0.313630859 -0.178373070 -0.101794509 [16] -0.084800801 -0.088590752 0.006091647 0.114961701 0.156091285 [21] 0.058135523 0.110407195 0.205110119 0.138507607 0.074390042 [26] 0.094949702 0.088255740 0.042526035 -0.101737568 -0.147652598 [31] -0.207911340 -0.258018827 -0.169110071 -0.214642624 -0.254957824 [36] -0.227732897 -0.155465599 > (mypacf <- c(rpacf$acf)) [1] 0.5126603608 0.1207465757 0.1070713800 0.2042135104 -0.0327187312 [6] -0.1278456771 -0.1065602128 -0.0245544056 -0.0515197543 -0.1209205892 [11] 0.0382101246 -0.3008585244 0.1434485497 0.1239942377 0.0205943057 [16] 0.1034743873 0.1196987413 0.1029938253 0.0229567336 -0.1166432478 [21] 0.0516424771 -0.0262026558 -0.0834857062 -0.1361980163 0.0659460450 [26] 0.0007063675 -0.0366454782 -0.1198206499 -0.0174564075 -0.1212690202 [31] -0.0525624879 0.1267110795 -0.0535698244 -0.0012872578 0.0176366967 [36] -0.0720818380 > 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/3pk4g1259310958.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/4ieza1259310958.tab") > > system("convert tmp/1356x1259310958.ps tmp/1356x1259310958.png") > system("convert tmp/2qh941259310958.ps tmp/2qh941259310958.png") > > > proc.time() user system elapsed 0.528 0.299 0.662