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(93.2,96,95.2,77.1,70.9,64.8,70.1,77.3,79.5,100.6,100.7,107.1,95.9,82.8,83.3,80,80.4,67.5,75.7,71.1,89.3,101.1,105.2,114.1,96.3,84.4,91.2,81.9,80.5,70.4,74.8,75.9,86.3,98.7,100.9,113.8,89.8,84.4,87.2,85.6,72,69.2,77.5,78.1,94.3,97.7,100.2,116.4,97.1,93,96,80.5,76.1,69.9,73.6,92.6,94.2,93.5,108.5,109.4,105.1,92.5,97.1) > 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/html/rcomp/tmp/1arbj1273053324.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/2arbj1273053324.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.700397821 0.375703763 0.002437988 -0.362643293 [6] -0.554512811 -0.668489886 -0.550197920 -0.310190559 0.018147082 [11] 0.297934103 0.569567207 0.710064579 0.522022601 0.283848781 [16] -0.014660793 -0.293038387 -0.464090941 -0.563979969 -0.457126457 [21] -0.252943881 0.018547756 0.214337007 0.411853670 0.505634363 [26] 0.374524140 0.213288823 -0.011615599 -0.227182358 -0.354229617 [31] -0.423434027 -0.343352889 -0.154528099 0.028380550 0.176689931 [36] 0.300232016 0.337636086 0.276834724 0.158289636 -0.015755071 [41] -0.154097667 -0.254425090 -0.287839519 -0.232619408 -0.120334889 [46] -0.013590147 0.091291379 0.145190941 0.172076678 > (mypacf <- c(rpacf$acf)) [1] 0.7003978210 -0.2254489094 -0.3352817854 -0.3568016056 -0.1156323872 [6] -0.2950013330 0.0006434468 -0.0170895075 0.1304192222 -0.0373618117 [11] 0.3318480390 0.2244499235 -0.2555987196 0.0126344451 0.1586777007 [16] -0.0166185880 -0.0426518949 -0.0035862800 0.0678921749 -0.0928396480 [21] 0.0596290224 -0.1420954967 -0.0072019931 0.0279673721 -0.0418188317 [26] -0.0422446030 0.0694584691 -0.0894904064 0.0322172176 0.0228459542 [31] 0.0245839038 0.0208279325 -0.0061335375 0.0115132424 -0.0628855864 [36] -0.0172940881 0.1352420451 -0.0515779632 -0.0384124302 0.0586695675 [41] -0.0042242459 0.0087913986 -0.0100313065 -0.0638461609 -0.0941543195 [46] 0.0458725612 -0.1406058456 -0.0580366988 > 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/3o1qs1273053324.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/4hsqv1273053324.tab") > > try(system("convert tmp/1arbj1273053324.ps tmp/1arbj1273053324.png",intern=TRUE)) character(0) > try(system("convert tmp/2arbj1273053324.ps tmp/2arbj1273053324.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.576 0.314 0.737