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(92.66,94.2,94.37,94.45,94.62,94.37,93.43,94.79,94.88,94.79,94.62,94.71,93.77,95.73,95.99,95.82,95.47,95.82,94.71,96.33,96.5,96.16,96.33,96.33,95.05,96.84,96.92,97.44,97.78,97.69,96.67,98.29,98.2,98.71,98.54,98.2,96.92,99.06,99.65,99.82,99.99,100.33,99.31,101.1,101.1,100.93,100.85,100.93,99.6,101.88,101.81,102.38,102.74,102.82,101.72,103.47,102.98,102.68,102.9,103.03,101.29) > par5 = '12' > par4 = '0' > 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/freestat/rcomp/tmp/1xgkr1228765111.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/2vf3h1228765111.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.00000000 0.92027891 0.87573892 0.83283933 0.79135928 0.74789368 [7] 0.73408667 0.64813810 0.59905025 0.55055672 0.50537866 0.46055518 [13] 0.44625535 0.37012224 0.32841269 0.28586242 0.24143691 0.19283273 [19] 0.17610120 0.10325474 0.06234360 0.02325983 -0.01791721 -0.05394247 [25] -0.06022030 -0.11604905 -0.14604251 -0.18203468 -0.21448575 -0.23816440 [31] -0.24309432 -0.28854996 -0.30857642 -0.33230860 -0.34851394 -0.35962788 [37] -0.35572290 -0.38696297 -0.39436412 -0.39948869 -0.40417775 -0.40818944 [43] -0.39459466 -0.40501511 -0.39505908 -0.38425552 -0.37880859 -0.37349325 [49] -0.35432205 -0.35188619 -0.32903343 -0.30753945 -0.28450223 -0.25831913 [55] -0.22365554 -0.19921060 -0.16282563 -0.13132716 -0.10211854 -0.07016362 [61] -0.03119428 > (mypacf <- c(rpacf$acf)) [1] 0.9202789063 0.1882962157 0.0364535097 0.0023815518 -0.0280776733 [6] 0.1733525807 -0.4255614588 0.0710397577 -0.0002751083 0.0045200894 [11] 0.0137759042 0.0816381090 -0.2103104940 0.0173351144 -0.0126919142 [16] -0.0525266763 -0.0495239930 0.0469038047 -0.1447099287 -0.0130918237 [21] 0.0052444036 -0.0376675263 0.0495473580 0.0213684154 -0.0778366050 [26] -0.0523829728 -0.0878835420 0.0075785059 0.0435149445 -0.0635327677 [31] -0.0267956310 -0.0166881720 -0.0263318744 0.0342884062 -0.0086508283 [36] -0.0461075654 -0.0352429841 -0.0153829770 0.0322679051 -0.0373917899 [41] -0.0446914216 0.0210686377 0.0465624847 -0.0101413898 0.0189928592 [46] -0.0539637019 -0.0487031526 -0.0072899959 0.0359194709 0.0248933031 [51] 0.0206120425 0.0602099038 0.0334999700 -0.0101407173 0.0564046542 [56] 0.0076624751 -0.0105499438 -0.0092655165 0.0272468718 0.0178911836 > 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/3d7hu1228765111.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/4h49l1228765111.tab") > > system("convert tmp/1xgkr1228765111.ps tmp/1xgkr1228765111.png") > system("convert tmp/2vf3h1228765111.ps tmp/2vf3h1228765111.png") > > > proc.time() user system elapsed 0.818 0.430 0.952