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(3258.1,3140.1,3627.4,3279.4,3204,3515.6,3146.6,2271.7,3627.9,3553.4,3018.3,3355.4,3242,3311.1,4125.2,3423,3120.3,3863,3240.8,2837.4,3945,3684.1,3659.6,3769.6,3592.7,3754,4507.8,3853.2,3817.2,3958.4,3428.9,3125.7,3977,3983.3,4299.6,4306.9,4259.5,3986,4755.6,3925.6,4206.5,4323.4,3816.1,3410.7,4227.4,4296.9,4351.7,3800,4277,4100.2,4672.5,4189.9,4231.9,4654.9,4298.5,3635.9,4505.1,4891.9,4894.2,4093.2) > 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/rcomp/tmp/1ds171229087841.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/2fan91229087841.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.372542567 -0.172060170 0.241309179 -0.284606967 [6] 0.128134118 0.109852791 -0.346333102 0.255865372 0.166802482 [11] -0.224103532 -0.009088443 0.002248073 -0.085016050 0.146528941 [16] -0.007169794 -0.122511621 0.159305883 0.025728616 -0.168326965 [21] 0.023110439 0.100291558 -0.098349396 0.199217736 -0.095732218 [26] -0.222213164 0.208700639 -0.005822462 -0.180913283 0.168976738 [31] -0.117527446 0.099929488 0.117391581 -0.279741536 0.106132738 [36] 0.070497269 -0.053773052 0.012825684 -0.020999980 0.010750324 [41] 0.060535384 -0.030199780 -0.068158475 0.053699683 0.036801110 [46] -0.026318093 -0.013127729 > (mypacf <- c(rpacf$acf)) [1] -0.3725425673 -0.3609426269 0.0261765851 -0.2867191165 -0.0440276032 [6] 0.0129765084 -0.2926317659 -0.0419480529 0.1981398771 0.0822555850 [11] -0.1782314066 -0.0929565487 -0.1031374010 -0.0818829079 0.0299962689 [16] -0.0037270143 -0.0118801344 0.0283160058 -0.0383952177 -0.1030682334 [21] 0.1296917559 -0.0007144987 0.1408510747 0.0416304299 -0.1818555987 [26] -0.1535293083 0.0518881222 -0.0442601057 -0.0731117214 -0.1319654027 [31] 0.0144236242 -0.0322034012 -0.1013160661 0.1050100977 -0.0454796015 [36] 0.0133380241 -0.1164003886 -0.0591592418 -0.0245887592 -0.0490991122 [41] 0.0158878670 0.0174817008 0.0418212298 -0.0903316795 0.0382512567 [46] 0.0628676530 > 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/3g12x1229087841.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/4hmna1229087841.tab") > > system("convert tmp/1ds171229087841.ps tmp/1ds171229087841.png") > system("convert tmp/2fan91229087841.ps tmp/2fan91229087841.png") > > > proc.time() user system elapsed 2.281 0.571 2.394