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(44.9,48.1,52.3,48.9,52.6,60.3,50.5,41.6,56,51.4,52.9,54.9,43.9,51,51.9,54.3,50.3,57.2,48.8,41.1,58,63,53.8,54.7,55.5,56.1,69.6,69.4,57.2,68,53.3,47.9,60.8,61.7,57.8,51.4,50.5,48.1,58.7,54,56.1,60.4,51.2,50.7,56.4,53.3,52.6,47.7,49.5,48.5,55.3,49.8,57.4,64.6,53,41.5,55.9,58.4,53.5,50.6,58.5) > par5 = '12' > par4 = '1' > par3 = '1' > 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/1z4021229172742.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/2ik0r1229172742.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.3601475396 -0.1161480468 0.2124619399 -0.2379585744 [6] 0.1042134458 0.1310445514 -0.1623346974 0.0774772048 -0.0081051605 [11] -0.0852359302 0.1207622421 -0.2025830905 0.0183976338 0.2151487201 [16] -0.3558282652 0.2464705829 0.0450542361 -0.2034532806 0.1731574976 [21] -0.0501661843 -0.0900651626 0.1434817628 0.0402119822 -0.2262396229 [26] 0.0963321803 -0.1046007004 0.0787186482 0.0653118512 -0.1233786087 [31] 0.0349405929 -0.0533206744 -0.0069966254 0.1232394142 -0.0920828296 [36] -0.0187346396 0.0812179036 -0.0361855468 -0.0102189982 0.0805731596 [41] -0.0623961960 0.0276029207 -0.0005547370 -0.0190019257 -0.0007081367 [46] 0.0061039438 -0.0082619482 0.0127847078 > (mypacf <- c(rpacf$acf)) [1] -0.360147540 -0.282495763 0.071268124 -0.185025573 -0.003617234 [6] 0.110292171 -0.003144578 0.014286203 -0.014166677 -0.040057961 [11] 0.032252199 -0.208789781 -0.118234402 0.117843374 -0.246373163 [16] 0.067693517 0.065085154 0.024492662 -0.003290471 0.001250728 [21] -0.001100112 -0.018744094 0.136174776 -0.218209311 -0.122478633 [26] -0.162083735 -0.039199623 -0.007262643 0.038882946 -0.102378326 [31] -0.022614585 0.001322029 0.024630110 -0.002873199 -0.031867581 [36] -0.074240177 -0.047313761 0.012481693 -0.099857864 0.065548661 [41] -0.003986734 -0.024695496 0.017892931 -0.056871033 -0.025352795 [46] -0.039661084 0.048439958 > 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/30g871229172742.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/4jvuq1229172742.tab") > > system("convert tmp/1z4021229172742.ps tmp/1z4021229172742.png") > system("convert tmp/2ik0r1229172742.ps tmp/2ik0r1229172742.png") > > > proc.time() user system elapsed 1.585 0.561 1.664