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(2400,4700,3700,2900,2800,3000,3100,3700,3000,2000,1900,1900,1800,3400,3800,2800,3100,2100,2000,2500,2400,2500,3300,3100,3700,5600,3700,2900,4000,2900,2400,3300,3800,4400,4000,3100,2700,5200,4600,3700,3200,2400,2200,3200,3100,2300,2500,2900,2700,5000,3500,3000,3800,2800,2400,2700,2800,2700,2600,3100) > 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/1suo21229948270.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/2t8er1229948270.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.033100705 -0.371453286 -0.283765081 0.060574185 [6] 0.212382724 0.010062018 -0.303880542 -0.005670860 0.243785587 [11] 0.331190918 -0.037317927 -0.516769730 -0.025619154 0.208731851 [16] 0.018588847 -0.069719724 -0.034165092 0.012966136 0.214107801 [21] -0.121835241 -0.135578375 -0.064735283 0.049535952 0.084956219 [26] -0.023464652 -0.117812570 0.120053138 0.058985279 -0.018072001 [31] -0.060017616 -0.058697741 0.118894711 0.042092018 -0.092162269 [36] -0.035427489 0.007948593 0.044938808 0.070522151 -0.057600854 [41] -0.022965561 -0.008187982 0.013180548 0.030376694 -0.031447852 [46] 0.011369556 -0.001977556 > (mypacf <- c(rpacf$acf)) [1] 0.033100705 -0.372957576 -0.295989450 -0.103996235 -0.004452692 [6] -0.090754126 -0.309171105 -0.027265746 0.043447132 0.278542827 [11] 0.171431649 -0.271734597 0.145021881 -0.060164124 -0.217169589 [16] -0.035597065 0.073806726 -0.113449473 -0.037859065 -0.220817983 [21] -0.040029341 0.055998710 -0.058700084 -0.165770109 0.040333536 [26] -0.095642331 -0.118890791 -0.013446873 0.040068859 -0.010095148 [31] 0.067954047 0.021240510 -0.014570805 0.054155081 -0.033049470 [36] -0.129518745 0.007857879 -0.084842615 -0.045917103 -0.028964611 [41] -0.134593140 -0.101240447 0.051827446 -0.040868277 0.054288526 [46] -0.047795432 > 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/39hk11229948271.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/4607e1229948271.tab") > > system("convert tmp/1suo21229948270.ps tmp/1suo21229948270.png") > system("convert tmp/2t8er1229948270.ps tmp/2t8er1229948270.png") > > > proc.time() user system elapsed 0.596 0.302 0.845