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(104.0,99.0,105.4,107.1,110.7,117.1,118.7,126.5,127.5,134.6,131.8,135.9,142.7,141.7,153.4,145.0,137.7,148.3,152.2,169.4,168.6,161.1,174.1,179.0,190.6,190.0,181.6,174.8,180.5,196.8,193.8,197.0,216.3,221.4,217.9,229.7,227.4,204.2,196.6,198.8,207.5,190.7,201.6,210.5,223.5,223.8,231.2,244.0,234.7,250.2,265.7,287.6,283.3,295.4,312.3,333.8,347.7,383.2,407.1,413.6,362.7,321.9,239.4,191.0,159.7,163.4,157.6,166.2,176.7,198.3,226.2,216.2,235.9) > 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/1olvu1259793674.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/2tczj1259793674.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.9527011594 0.8687898409 0.7588215274 0.6438054880 [6] 0.5330098647 0.4408985022 0.3700680304 0.3169749229 0.2804947869 [11] 0.2581947297 0.2387445432 0.2133570127 0.1889685297 0.1637812627 [16] 0.1407452366 0.1128146547 0.0883994996 0.0716914133 0.0603746616 [21] 0.0556539483 0.0554445189 0.0491369330 0.0440299366 0.0332251991 [26] 0.0222075509 -0.0008246556 -0.0338213394 -0.0704692926 -0.1041726908 [31] -0.1289454235 -0.1512663531 -0.1645021166 -0.1704610446 -0.1725031545 [36] -0.1754985149 -0.1788708466 -0.1879260481 -0.2075448403 -0.2280915151 [41] -0.2477090003 -0.2652847399 -0.2852973166 -0.2997256843 -0.3081963515 [46] -0.3105464771 -0.3126447937 -0.3153439763 -0.3178775333 > (mypacf <- c(rpacf$acf)) [1] 0.9527011594 -0.4206306584 -0.2143541219 0.0387920958 0.0192983114 [6] 0.1141223103 0.0538444335 -0.0298252126 0.0259689162 0.0400018790 [11] -0.0822397013 -0.1013209772 0.0915480014 0.0131852003 0.0197387065 [16] -0.1039994323 0.0274263455 0.0951360708 -0.0157291470 0.0004720845 [21] -0.0166484888 -0.1164411887 0.1078683408 -0.0655128446 0.0002956391 [26] -0.1363119865 -0.0605238701 0.0319517905 0.0385643195 0.0401080184 [31] -0.1366735223 0.0468178523 0.0277135392 -0.0645107919 -0.0605105282 [36] -0.0415756209 0.0222669457 -0.1220802824 0.0525203027 -0.0361600697 [41] -0.0380796308 -0.0420483988 -0.0086896990 -0.0108058421 -0.0120511748 [46] -0.0872111839 -0.0255433336 0.0024149534 > 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/3q6no1259793674.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/4a8zn1259793674.tab") > > system("convert tmp/1olvu1259793674.ps tmp/1olvu1259793674.png") > system("convert tmp/2tczj1259793674.ps tmp/2tczj1259793674.png") > > > proc.time() user system elapsed 0.574 0.310 0.809