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(104.3,103.9,103.9,103.9,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.0,108.2,112.3,111.3,111.3,115.3,117.2,118.3,118.3,118.3,119.0,120.6,122.6,122.6,127.4,125.9,121.5,118.8,121.6,122.3,122.7,120.8,120.1,120.1,120.1,120.1,128.4,129.8,129.8,128.6,128.6,133.7,130.0,125.9,129.4,129.4,130.6,130.6,130.6,130.8,129.7,125.8,126.0,125.6,125.4,124.7,126.9,129.1) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '48' > #'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/freestat/rcomp/tmp/1ypik1229539657.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/freestat/rcomp/tmp/2r59s1229539657.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.088588341 0.016481113 0.163064150 -0.249472104 [6] 0.114473773 -0.009348398 -0.157812949 0.201423323 -0.129219564 [11] -0.188521203 -0.162429293 -0.455691400 0.056878087 -0.060033584 [16] -0.175263403 0.168341517 0.010603895 -0.002180373 0.056339988 [21] -0.003877115 0.152262450 0.138957878 0.043372758 0.083413328 [26] 0.028327447 0.152889775 0.022050861 -0.173852824 0.053477567 [31] -0.072233484 -0.076423302 0.003717566 -0.049680164 0.020133169 [36] 0.010279648 -0.156465643 -0.055933006 -0.079471887 0.008867431 [41] 0.083016624 -0.110505173 0.091741483 0.059503588 -0.058255938 [46] 0.016550458 -0.015429595 0.002929157 0.085081108 > (mypacf <- c(rpacf$acf)) [1] 0.0885883409 0.0087015077 0.1621305302 -0.2876127051 0.1932340106 [6] -0.0989456415 -0.0457792186 0.1251886314 -0.1180719789 -0.1674351736 [11] -0.2569434950 -0.3262642768 0.1175458682 -0.1582674055 -0.0827703063 [16] -0.0415930604 0.1337056375 -0.0918179145 -0.0581328936 0.1550771401 [21] -0.0204007037 -0.0544415758 -0.0773410781 -0.0894966523 0.0395637216 [26] 0.0826840088 -0.0388889613 -0.1489863998 0.1183197196 -0.1187772201 [31] 0.0178466324 0.0831322944 0.1019593212 -0.0524445001 0.0383122304 [36] -0.1058595318 0.0046094241 -0.0593991305 0.0021808403 -0.0869025547 [41] -0.0465322743 -0.0737662077 -0.0001551973 0.0902169046 -0.0258471224 [46] -0.0600659667 -0.0261149177 -0.0755869232 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/31qb91229539657.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/freestat/rcomp/tmp/4bbas1229539658.tab") > > system("convert tmp/1ypik1229539657.ps tmp/1ypik1229539657.png") > system("convert tmp/2r59s1229539657.ps tmp/2r59s1229539657.png") > > > proc.time() user system elapsed 0.798 0.433 0.911