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(84.9,81.9,95.9,81,89.2,102.5,89.8,88.8,83.2,90.2,100.4,187.1,87.6,85.4,86.1,86.7,89.1,103.7,86.9,85.2,80.8,91.2,102.8,182.5,80.9,83.1,88.3,86.6,93,105.3,93.8,86.4,87,96.7,100.5,196.7,86.8,88.2,93.8,85,90.4,115.9,94.9,87.7,91.7,95.9,106.8,204.5,90.2,90.5,93.2,97.8,99.4,120,108.2,98.5,104.3,102.9,111.1,188.1,93.8,94.5,112.4,102.5,115.8,136.5,122.1,110.6,116.4,112.6,121.5,199.3) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/html/rcomp/tmp/1vr8w1290268092.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/2vr8w1290268092.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.407087155 -0.065080797 0.018850986 -0.077846842 [6] -0.109014041 0.319737654 -0.078201113 -0.092747734 0.047120522 [11] -0.066455290 -0.389796831 0.817685160 -0.332186271 -0.054130045 [16] 0.015273265 -0.060685053 -0.093654507 0.259088341 -0.052608508 [21] -0.087803509 0.051753657 -0.062808320 -0.326944436 0.639826657 [26] -0.238622428 -0.038961400 0.008833342 -0.040044758 -0.085623151 [31] 0.197982827 -0.028951654 -0.077600070 0.047120182 -0.056053925 [36] -0.225879120 0.429923198 -0.146947414 -0.031917634 0.002776829 [41] -0.020440885 -0.055770146 0.120137069 -0.010960594 -0.055868854 [46] 0.043353090 -0.042352660 -0.131155886 0.220336420 > (mypacf <- c(rpacf$acf)) [1] -0.407087155 -0.276646612 -0.165610423 -0.211143750 -0.351982172 [6] 0.066437270 0.090820557 -0.012226000 0.013753722 -0.021221565 [11] -0.609382470 0.543431206 0.090771995 -0.003233879 -0.002985084 [16] -0.014863550 0.125990898 -0.081204381 -0.054681621 0.015839240 [21] -0.063389674 -0.065130802 0.031140515 -0.084823374 0.052244666 [26] 0.032247750 0.015853871 0.075278875 -0.015073275 -0.009136033 [31] -0.008696853 -0.040733784 -0.035310627 -0.053833914 0.126508922 [36] -0.129349980 -0.022432911 0.003408851 -0.011605802 0.027074068 [41] 0.013400424 -0.042107641 -0.019348397 -0.026085713 0.018400056 [46] 0.047634298 0.017176727 -0.121309499 > 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/3zs721290268092.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/4kanq1290268092.tab") > > try(system("convert tmp/1vr8w1290268092.ps tmp/1vr8w1290268092.png",intern=TRUE)) character(0) > try(system("convert tmp/2vr8w1290268092.ps tmp/2vr8w1290268092.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.574 0.315 1.307