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(90.7,94.3,104.6,111.1,110,107.2,99,99,91,96.2,96.9,96.2,100.1,99,115.4,106.9,107.1,99.3,99.2,108.3,105.6,99.5,107.4,93.1,88.1,110.7,113.1,99.6,93.6,98.6,99.6,114.3,107.8,101.2,112.5,100.5,93.9,116.2,112,106.4,95.7,96,95.8,103,102.2,98.4,111.4,86.6,91.3,107.9,101.8,104.4,93.4,100.1,98.5,112.9,101.4,107.1,110.8,90.3,95.5,111.4,113,107.5,95.9,106.3,105.2,117.2,106.9,108.2,113,97.2,99.9,108.1,118.1,109.1,93.3,112.1,111.8,112.5,116.3,110.3,117.1,103.4,96.2) > 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/1kdiw1229709003.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/2htyj1229709003.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.280319914 0.238610894 0.137500783 0.029633954 [6] 0.064821272 0.120112294 -0.047589114 -0.139195793 0.005004230 [11] -0.143569741 -0.029460075 -0.127630984 -0.112416291 -0.093099114 [16] -0.027670526 -0.078266675 0.019002251 -0.054568993 0.002241901 [21] 0.077741321 0.025118821 -0.072513951 0.093909438 -0.083044630 [26] -0.035255557 0.123156671 -0.099839191 -0.072504892 -0.128159223 [31] -0.089534432 -0.148578798 0.061912114 -0.091756777 -0.045970996 [36] -0.008235118 -0.103646609 -0.041210817 -0.161119915 -0.091193704 [41] -0.032554614 0.082076820 -0.003011993 0.083049787 -0.042333492 [46] 0.017670552 0.076624560 0.008956149 0.015157961 0.047932486 [51] -0.029426275 -0.005173884 0.061372600 -0.023254779 -0.080824902 [56] 0.035355864 -0.004063526 0.002372739 0.090769926 -0.047218283 [61] 0.049493355 > (mypacf <- c(rpacf$acf)) [1] 0.2803199139 0.1736792234 0.0375376052 -0.0573856264 0.0428883308 [6] 0.1106142659 -0.1262596849 -0.1765315189 0.1097297667 -0.0953249468 [11] 0.0087383624 -0.1283886316 -0.0001814246 0.0062209136 0.0040112457 [16] -0.0626456692 0.0763907894 -0.0670514312 0.0524777286 0.0347977286 [21] 0.0016587073 -0.1601816203 0.1597131131 -0.1469714858 -0.0071518977 [26] 0.1028678064 -0.1008256632 -0.0927386527 -0.1103686358 0.0324647274 [31] -0.0591882982 0.0519436569 -0.0084574711 -0.0369590435 0.0160764704 [36] -0.1128696290 -0.0423897541 -0.1819637550 -0.0026527279 0.0631673410 [41] 0.0675474171 -0.0461660811 0.0074953683 -0.0532168346 0.0365887119 [46] -0.0850268735 -0.0010781417 0.0172158003 -0.0035680707 -0.0528360819 [51] -0.0276637360 -0.0051642366 -0.0136552746 -0.1249457532 0.1058747625 [56] -0.0050418457 0.0446063164 -0.0492368658 -0.0089788153 -0.0179822409 > 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/335bh1229709003.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/4v0be1229709003.tab") > > system("convert tmp/1kdiw1229709003.ps tmp/1kdiw1229709003.png") > system("convert tmp/2htyj1229709003.ps tmp/2htyj1229709003.png") > > > proc.time() user system elapsed 0.599 0.321 0.724