R version 2.8.0 (2008-10-20) 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(130.3,130.9,104.7,115.2,124.5,112.3,127.5,120.6,117.5,117.7,120.4,125,131.6,121.1,114.2,112.1,127,116.8,112,129.7,113.6,115.7,119.5,125.8,129.6,128,112.8,101.6,123.9,118.8,109.1,130.6,112.4,111,116.2,119.8,117.2,127.3,107.7,97.5,120.1,110.6,111.3,119.8,105.5,108.7,128.7,119.5,121.1,128.4,108.8,107.5,125.6,102.9,107.5,120.4,104.3,100.6,121.9,112.7,124.9,123.9,102.2,104.9,109.8,98.9,107.3,112.6,104,110.6,100.8,103.8,117,108.4,95.5,96.9,103.9,101.1,100.6,104.3,98,99.5,97.4,105.6,117.5,107.4,97.8,91.5,107.7,100.1,96.6,106.8,98,98.6) > par5 = '12' > par4 = '0' > 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/1t5b91229898942.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/2lcht1229898942.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.415866873 0.244951687 0.506948969 0.243085412 [6] 0.329822643 0.562241083 0.253366919 0.222397812 0.400912597 [11] 0.166228807 0.341401817 0.653098680 0.258935358 0.145476573 [16] 0.299219759 0.092719157 0.179032383 0.326398392 0.083278173 [21] 0.052415125 0.158401221 -0.001666580 0.169390645 0.344642431 [26] 0.105821579 -0.016911090 0.071910787 -0.066522777 -0.014015270 [31] 0.117413031 -0.040572543 -0.086853831 -0.031598885 -0.106374660 [36] 0.010626648 0.205202760 0.012630598 -0.112794516 -0.033707494 [41] -0.117596822 -0.109275865 0.001537836 -0.097121718 -0.155130547 [46] -0.106446891 -0.140721443 -0.087833417 0.086534879 -0.069501367 [51] -0.185456615 -0.112479636 -0.155903285 -0.164649786 -0.094272888 [56] -0.160062275 -0.230869346 -0.177051458 -0.234581119 -0.178127203 [61] -0.032835818 > (mypacf <- c(rpacf$acf)) [1] 0.4158668733 0.0870636817 0.4602221546 -0.1530092033 0.3475311837 [6] 0.2299062758 -0.0614417260 -0.0084833474 0.0647501938 -0.1081301140 [11] 0.2790205270 0.3730499958 -0.1123766743 -0.2087176283 -0.1809880166 [16] -0.1140426926 -0.0999786096 -0.0829951802 0.0352572485 -0.0621508414 [21] -0.0172057386 -0.0437123978 0.0879656475 0.0021929704 0.1453858089 [26] -0.1472069450 0.0312375901 -0.1676391030 -0.0174050757 -0.0435206087 [31] 0.1197447534 0.0091426544 0.0248397854 -0.0215578050 0.0009652912 [36] 0.1460821887 -0.0192758194 0.0148942779 -0.0416733191 0.0123628935 [41] -0.1033984916 -0.1069222434 0.0110646908 -0.0036865840 0.0470379570 [46] -0.0205892540 -0.0527259622 -0.0866057231 -0.0869392119 -0.0389190692 [51] -0.0038513793 0.0743878580 0.0208592494 -0.0627966802 -0.0683537076 [56] -0.0588748095 -0.0202058461 -0.0950120664 0.0093010371 0.0012708606 > 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/3l79a1229898942.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/4m0nb1229898943.tab") > > system("convert tmp/1t5b91229898942.ps tmp/1t5b91229898942.png") > system("convert tmp/2lcht1229898942.ps tmp/2lcht1229898942.png") > > > proc.time() user system elapsed 0.635 0.340 0.753