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(93.0,99.2,112.2,112.1,103.3,108.2,90.4,72.8,111.0,117.9,111.3,110.5,94.8,100.4,132.1,114.6,101.9,130.2,84.0,86.4,122.3,120.9,110.2,112.6,102.0,105.0,130.5,115.5,103.7,130.9,89.1,93.8,123.8,111.9,118.3,116.9,103.6,116.6,141.3,107.0,125.2,136.4,91.6,95.3,132.3,130.6,131.9,118.6,114.3,111.3,126.5,112.1,119.3,142.4,101.1,97.4,129.1,136.9,129.8,123.9) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '2.0' > 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/12eh21229685780.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/2c5qg1229685780.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.5326905474 -0.0833570665 0.3108825311 -0.2256533334 [6] -0.0833283442 0.2082221322 -0.1483387073 0.1332795324 -0.0811708166 [11] -0.0490417701 0.2087966864 -0.2569651603 0.0639924627 0.0686421686 [16] -0.0326576017 -0.1403652894 0.2895586351 -0.1501029131 -0.0883734322 [21] 0.0658415925 0.1434946313 -0.2852310643 0.2319474559 -0.0230514752 [26] -0.1176087376 0.1209909348 -0.0669105125 0.0367039837 0.0329433413 [31] -0.1264517541 0.1192646017 0.0400629959 -0.2083522743 0.2426876152 [36] -0.1241986085 -0.0645977885 0.1199717472 -0.0641067051 -0.0409966521 [41] 0.1201478622 -0.0790079255 -0.0128300258 0.0570581295 -0.0533094227 [46] 0.0248293040 -0.0006204152 > (mypacf <- c(rpacf$acf)) [1] -0.5326905474 -0.5125598759 -0.0555156703 -0.0804409109 -0.2647126687 [6] -0.1751271378 -0.1930857833 0.1101495010 -0.0198577956 -0.1404916671 [11] 0.1356537411 -0.0263161548 -0.0605707733 -0.2365633004 -0.0092068454 [16] -0.2736972521 -0.0254184175 0.0118595248 -0.1227592281 -0.2677383343 [21] 0.0594806898 -0.1239544753 0.0018521755 -0.0802237687 -0.0990239607 [26] -0.0422640993 -0.0633998125 -0.0597862530 0.0217825877 -0.0449663024 [31] -0.0062033620 -0.0018479727 0.0718731825 0.0105790941 -0.0006215269 [36] -0.0112951608 0.0617199294 -0.1444357019 -0.0878071333 -0.0373792968 [41] 0.0885206066 -0.0893013010 0.0253156785 -0.0112036262 0.0690724076 [46] 0.0081153777 > 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/3j32d1229685780.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/4x5wc1229685781.tab") > > system("convert tmp/12eh21229685780.ps tmp/12eh21229685780.png") > system("convert tmp/2c5qg1229685780.ps tmp/2c5qg1229685780.png") > > > proc.time() user system elapsed 0.599 0.321 0.739