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(2174.56,2196.72,2350.44,2440.25,2408.64,2472.81,2407.6,2454.62,2448.05,2497.84,2645.64,2756.76,2849.27,2921.44,2981.85,3080.58,3106.22,3119.31,3061.26,3097.31,3161.69,3257.16,3277.01,3295.32,3363.99,3494.17,3667.03,3813.06,3917.96,3895.51,3801.06,3570.12,3701.61,3862.27,3970.1,4138.52,4199.75,4290.89,4443.91,4502.64,4356.98,4591.27,4696.96,4621.4,4562.84,4202.52,4296.49,4435.23,4105.18,4116.68,3844.49,3720.98,3674.4,3857.62,3801.06,3504.37,3032.6,3047.03,2962.34) > 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/rcomp/tmp/1db641228673329.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/2tkqx1228673329.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.9476579964 0.8869476594 0.8289246643 0.7808418935 [6] 0.7354013712 0.6835883886 0.6166206604 0.5493919809 0.4773224771 [11] 0.4122640064 0.3512398661 0.2932168990 0.2327624850 0.1723541266 [16] 0.1178061063 0.0691920139 0.0231059731 -0.0221050362 -0.0708064436 [21] -0.1143890750 -0.1546873895 -0.1912525094 -0.2248180936 -0.2545986403 [26] -0.2832031810 -0.3137324919 -0.3423072573 -0.3685759200 -0.3830072942 [31] -0.3907387753 -0.3979898146 -0.4149682889 -0.4289127980 -0.4371350984 [36] -0.4409303168 -0.4333623426 -0.4220022456 -0.4056367758 -0.3821168343 [41] -0.3570089669 -0.3358539266 -0.2998745489 -0.2574790491 -0.2141966497 [46] -0.1738536294 -0.1459808031 -0.1110926548 -0.0693420376 -0.0417786285 [51] -0.0146800447 -0.0009001248 0.0077776763 0.0139806442 0.0323862117 [56] 0.0497778089 0.0554077482 0.0395544540 0.0217945747 > (mypacf <- c(rpacf$acf)) [1] 0.9476579964 -0.1089616233 0.0007467288 0.0622988833 -0.0154257874 [6] -0.0887031818 -0.1638369271 -0.0219604098 -0.1100637623 0.0036442028 [11] -0.0187190189 -0.0117129662 -0.0486700033 -0.0336752447 0.0255596710 [16] -0.0167548701 -0.0292963649 -0.0405081098 -0.0717204629 0.0006022168 [21] -0.0396278576 -0.0290810657 -0.0274629354 -0.0051783807 -0.0270046569 [26] -0.0752372898 -0.0220173487 -0.0491054412 0.0606379366 0.0032865718 [31] -0.0299088960 -0.1220206836 -0.0015263630 0.0009701935 -0.0552339052 [36] 0.0689000613 -0.0035694353 0.0552303321 0.0579919856 0.0079765116 [41] -0.0723564867 0.1234112743 0.0518841892 -0.0139051738 -0.0127344804 [46] -0.1239234907 0.0873474779 0.0328599736 -0.1648389593 0.0339340906 [51] -0.1287750811 -0.0177376018 -0.0417328735 0.1200313381 -0.0355218844 [56] -0.1236866591 -0.1216961185 -0.0123639806 > 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/3hezr1228673329.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/4nvq81228673330.tab") > > system("convert tmp/1db641228673329.ps tmp/1db641228673329.png") > system("convert tmp/2tkqx1228673329.ps tmp/2tkqx1228673329.png") > > > proc.time() user system elapsed 0.591 0.316 0.698