R version 2.7.0 (2008-04-22) Copyright (C) 2008 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(94,118.6,135,132.7,110.1,111,159.4,129.9,124.8,140.5,120.6,121.6,107.3,130.7,134.9,128.3,99.8,96.7,134.1,131.6,118,133.2,109.3,111.9,98.3,116.3,113.6,121.3,93.7,92.3,132,114.3,123.1,117.3,106,107.5,104.3,112.6,113.9,132.8,88.8,97.7,131.2,116.1,124.7,128.2,105,102.3,98.4,111.1,125.3,123.6,86.7,100.6,123.3,112.2,120.8,114.8,107.3,107.5,93.1,112.4,127.9,120.7,91,98.5,118.9,113.8,113.8,118.7,105.1,101.4,84.1,107.2,119.9,105.4,88.6,90.5,108.5,104.7,100,113.1,96.7,98.5) > par5 = '12' > par4 = '1' > 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: Write here your technical program description (don't use hard returns!) > 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 (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/14vt81228843972.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2n4ij1228843972.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.239837911 0.280533585 0.211181008 0.093184815 [6] 0.111646820 0.083658940 0.165075815 0.095512667 0.168225034 [11] -0.128281898 -0.018038584 -0.217265864 -0.182402536 -0.123714273 [16] -0.070507358 -0.128383539 -0.025438849 -0.155567866 -0.201494847 [21] -0.022429245 -0.179414541 -0.073992289 0.014457457 -0.002871734 [26] -0.064479695 0.093418297 -0.110531734 -0.072926987 -0.022928742 [31] -0.030890702 0.056047469 -0.067457359 -0.051981942 -0.109468329 [36] -0.124667164 -0.195412759 -0.016787191 -0.090380710 -0.081450669 [41] -0.022948872 -0.124928324 -0.065601915 -0.128290153 -0.083339927 [46] -0.034505714 0.029545070 0.056482191 0.040752460 0.118762822 [51] 0.087317852 0.065450075 0.081986472 0.074967614 0.125608676 [56] 0.100742190 0.092676773 0.152835514 0.047998727 0.016692829 [61] 0.021065732 > (mypacf <- c(rpacf$acf)) [1] 0.2398379112 0.2366224082 0.1158446702 -0.0317912349 0.0269110258 [6] 0.0282845260 0.1286511580 0.0140003462 0.0871125927 -0.2706944184 [11] -0.0354791725 -0.2172224552 -0.0647679095 -0.0296561149 0.0916295937 [16] -0.1196256291 0.1193849469 -0.1576257781 0.0007434481 0.0876210994 [21] 0.0140550068 -0.0891490798 0.1134043133 -0.0769247356 -0.0518087546 [26] 0.0851787930 -0.0861276397 -0.1332944186 0.0023423689 0.0199679603 [31] -0.0052181019 -0.1194357395 -0.0592656716 -0.1371245461 -0.0830213557 [36] -0.0297032231 0.0625057488 -0.0314234625 -0.0199108673 -0.0867361597 [41] -0.0529581903 0.0557377511 -0.0831527051 -0.0297039211 0.0287137864 [46] -0.1163734139 0.0642531378 -0.0216761470 0.0889910554 0.0336180416 [51] -0.0241435435 -0.0596132752 -0.0225807763 -0.0271329307 0.0145015673 [56] -0.0777108101 0.0379451795 -0.0622948425 -0.0501818617 -0.0387217014 > 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/3c0mi1228843972.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/435b81228843972.tab") > > system("convert tmp/14vt81228843972.ps tmp/14vt81228843972.png") > system("convert tmp/2n4ij1228843972.ps tmp/2n4ij1228843972.png") > > > proc.time() user system elapsed 2.767 0.966 2.896