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 = '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/1v8al1229944288.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/215e21229944288.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.0071897527 0.1002263812 0.2487374559 -0.0809440479 [6] 0.1303138749 0.1612922765 -0.1035818455 0.0964850499 0.2288202506 [11] -0.1643999717 -0.0513015367 -0.1501583974 -0.2209756447 0.0868609679 [16] -0.0752636015 -0.1393429098 0.1640336146 -0.0904731686 -0.2053301089 [21] 0.0001023356 -0.0639838931 -0.1387510271 0.1737597295 -0.2804892483 [26] -0.0862426608 0.0383763565 -0.0370297624 -0.0796042384 0.0005484861 [31] -0.0132648237 0.0574175909 0.1261697665 -0.1541772107 0.0580395474 [36] 0.1070617783 0.0552370936 0.2126123452 0.0718647793 -0.0440751661 [41] 0.1169543033 -0.0129443583 -0.0832778129 0.0634408743 0.0593944181 [46] -0.0999428149 0.1318400253 -0.0921380222 -0.1392211089 -0.0061474124 [51] -0.1255763608 -0.1137020438 0.0714861975 -0.0695358782 -0.0303162962 [56] 0.0317755764 -0.1983683225 0.0009713725 -0.0256794666 -0.0949331773 [61] 0.0361065534 > (mypacf <- c(rpacf$acf)) [1] 0.007189753 0.100179867 0.249889454 -0.094819366 0.086654462 [6] 0.127161480 -0.092336811 0.013886891 0.227776722 -0.149612241 [11] -0.197269815 -0.220398361 -0.108133172 0.088579881 0.014154054 [16] -0.028268238 0.179807884 -0.019583285 -0.216287575 -0.052388051 [21] 0.210231706 -0.122312650 -0.028112733 -0.309770174 -0.093461689 [26] -0.107030926 0.298036712 0.054829200 0.076886791 -0.029522064 [31] -0.019852552 -0.018794543 0.047199796 0.030800695 0.064404127 [36] -0.061106306 0.026591283 -0.044381378 0.003788130 -0.055280801 [41] 0.071968156 -0.009857140 -0.032848429 -0.088665440 -0.076679085 [46] 0.025636059 0.090816384 -0.149082190 -0.009886768 -0.058043426 [51] -0.005030791 -0.034038579 0.019453127 0.017700478 0.043362638 [56] -0.064055943 -0.024118669 -0.110308334 0.059460283 0.013032588 > 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/3wv8u1229944288.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/49j9s1229944288.tab") > > system("convert tmp/1v8al1229944288.ps tmp/1v8al1229944288.png") > system("convert tmp/215e21229944288.ps tmp/215e21229944288.png") > > > proc.time() user system elapsed 0.597 0.326 0.824