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(40628,40167,43375,45610,46255,44375,35461,38096,40813,41582,44461,46390,45744,47990,51847,56641,55016,53119,44471,45200,46256,46922,48965,49447,51702,52837,56273,59070,57871,54862,44357,45264,47111,49050,50518,51824,53495,54623,58088,61321,60205,56527,45623,46127,48141,50648,52441,53661,54156,54245,58182,60436,59412,55903,43648,43555,45483,46956,49087,50433,50505,50890,53703,55276,53959,49732,37776,38437,40187,41626,42682,43647,43625,44352,49669,50986,48869,43127,33629,34948,36346,37607,38948,40274,40044,41139,45041,47433,48126,41639,33538,34742,37152,38399,41374,43363,44071,45080,48487,52140,52780,46700,38202,39915,42199,44356,46188,47883,48149,48201,51438,55796,55989,48794,39252,41414,43856,46086,48284,50101) > 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/1vzh71229613512.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/2bp4a1229613512.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.038719829 0.053528846 -0.042419538 0.071156766 [6] -0.002400532 0.027997280 0.129701558 -0.074284111 0.158189317 [11] -0.084056002 0.184923259 -0.146706013 -0.003589238 0.039114434 [16] -0.042769554 -0.025204550 -0.084050310 -0.014195298 -0.101701348 [21] 0.055881752 0.096293278 0.058022184 -0.026221457 -0.059107766 [26] -0.065073205 -0.029363506 0.029603877 0.013843908 0.060917353 [31] -0.077530754 -0.063653333 0.070770732 -0.033307136 -0.052405623 [36] 0.030120911 -0.073442793 0.017072012 0.002267284 -0.102154166 [41] -0.071065230 -0.006616894 -0.041906788 0.092138754 -0.043472364 [46] -0.022642043 0.024577696 -0.077507013 -0.068610106 -0.028721197 [51] 0.104454925 -0.076732196 -0.017875884 -0.057684556 0.052406995 [56] 0.008288385 -0.022141943 0.021981581 -0.114165084 0.078136818 [61] 0.016557520 > (mypacf <- c(rpacf$acf)) [1] -0.038719829 0.052107742 -0.038599827 0.065852149 0.006454057 [6] 0.019893153 0.137873609 -0.074154102 0.148013404 -0.066825803 [11] 0.155472032 -0.127472638 -0.047598547 0.061473461 -0.077006676 [16] -0.044078689 -0.061096586 -0.092451782 -0.016703809 -0.018753714 [21] 0.179011059 0.042210491 0.019312604 -0.023966964 -0.108535122 [26] 0.031498744 0.006298567 0.007477143 0.075765643 -0.132862424 [31] -0.071330595 0.048068842 -0.030571841 -0.017168336 0.019175161 [36] -0.090925425 0.049021304 0.004757511 -0.077084439 -0.038953528 [41] -0.009478501 -0.074732482 0.073123932 -0.041515858 0.057044997 [46] 0.044380133 -0.064746044 -0.092098310 -0.063703415 0.121383771 [51] -0.044573239 -0.058738478 -0.013364770 -0.017953307 0.057332989 [56] -0.047376434 0.010992962 -0.086707467 0.045990585 0.103466371 > 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/3slsz1229613512.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/4mrpp1229613512.tab") > > system("convert tmp/1vzh71229613512.ps tmp/1vzh71229613512.png") > system("convert tmp/2bp4a1229613512.ps tmp/2bp4a1229613512.png") > > > proc.time() user system elapsed 1.546 0.571 1.644