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(87.0,96.3,107.1,115.2,106.1,89.5,91.3,97.6,100.7,104.6,94.7,101.8,102.5,105.3,110.3,109.8,117.3,118.8,131.3,125.9,133.1,147.0,145.8,164.4,149.8,137.7,151.7,156.8,180.0,180.4,170.4,191.6,199.5,218.2,217.5,205.0,194.0,199.3,219.3,211.1,215.2,240.2,242.2,240.7,255.4,253.0,218.2,203.7,205.6,215.6,188.5,202.9,214.0,230.3,230.0,241.0,259.6,247.8,270.3,289.7) > 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/1bgc31229878423.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/2r2js1229878423.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.920841530 0.853924341 0.810497271 0.758939194 [6] 0.710942010 0.657689714 0.611006621 0.570890166 0.544455341 [11] 0.538259902 0.499579958 0.458930184 0.420010661 0.379949055 [16] 0.318244950 0.245283781 0.187571327 0.128357444 0.073409670 [21] 0.036606473 -0.003630393 -0.049841021 -0.086151411 -0.107716130 [26] -0.141100201 -0.196572201 -0.250272280 -0.292786483 -0.319989012 [31] -0.330871943 -0.359782093 -0.383851272 -0.392477857 -0.390873186 [36] -0.375597798 -0.377645197 -0.394611137 -0.399773527 -0.401433239 [41] -0.396505358 -0.389316573 -0.378574225 -0.364845298 -0.350030136 [46] -0.322217689 -0.296859476 -0.283467532 -0.274833896 -0.262586383 [51] -0.240884848 -0.238634702 -0.227964698 -0.212747182 -0.186763491 [56] -0.158188931 -0.135039658 -0.110692840 -0.088801847 -0.051458450 > (mypacf <- c(rpacf$acf)) [1] 0.920841530 0.039297493 0.124375958 -0.055130118 0.011266592 [6] -0.070720759 0.017484195 0.007264032 0.089420425 0.138912923 [11] -0.177516520 -0.033404713 -0.085487162 -0.019168352 -0.198329049 [16] -0.110476484 0.003140741 -0.047772070 -0.017976898 0.022686550 [21] -0.011458528 -0.097365150 -0.012476586 0.015579778 -0.046000480 [26] -0.141230190 -0.087094389 0.018357599 0.104959456 0.118633821 [31] -0.125152086 0.018001031 0.015927107 -0.007150234 0.068085700 [36] -0.025181149 -0.080479816 -0.003089795 0.007271951 0.041849556 [41] 0.081054717 0.016499105 -0.030707314 -0.072704390 0.021792300 [46] 0.006857916 -0.066608092 -0.085384664 -0.026271839 0.061703665 [51] -0.073781113 0.072878008 -0.052841226 0.058177116 -0.074927945 [56] -0.017812453 0.036870339 0.014338729 0.084250541 > 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/3xlsg1229878423.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/4x1we1229878423.tab") > > system("convert tmp/1bgc31229878423.ps tmp/1bgc31229878423.png") > system("convert tmp/2r2js1229878423.ps tmp/2r2js1229878423.png") > > > proc.time() user system elapsed 0.603 0.318 0.699