R version 2.8.1 (2008-12-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(4.2,4.19,4.19,4.19,4.19,4.18,4.2,4.19,4.17,4.21,4.22,4.23,4.21,4.23,4.23,4.22,4.25,4.28,4.3,4.32,4.33,4.32,4.34,4.33,4.31,4.31,4.3,4.3,4.29,4.33,4.32,4.32,4.35,4.37,4.39,4.4,4.41,4.44,4.47,4.47,4.47,4.48,4.47,4.48,4.46,4.44,4.43,4.41,4.41,4.38,4.35,4.37,4.4,4.39,4.36,4.34,4.33,4.33,4.34,4.34,4.35,4.37,4.39,4.4,4.38,4.37,4.36,4.33,4.33,4.33,4.32,4.33,4.34) > par5 = '12' > par4 = '0' > par3 = '0' > 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/1gi0k1241720152.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/23vla1241720152.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.00000000 0.96171333 0.91052875 0.85700081 0.79525902 0.72960715 [7] 0.65946137 0.59673135 0.53282830 0.46951445 0.41380917 0.35849491 [13] 0.30650690 0.25570261 0.21369333 0.17266157 0.13319920 0.09998491 [19] 0.07966318 0.06304531 0.04328598 0.01687417 -0.01265500 -0.03807858 [25] -0.07601978 -0.12217481 -0.16989388 -0.22015718 -0.26768610 -0.31599971 [31] -0.35377218 -0.39075728 -0.42324847 -0.44518780 -0.45716178 -0.46327600 [37] -0.46332425 -0.45437395 -0.43233025 -0.39680213 -0.36146416 -0.32416579 [43] -0.28432052 -0.25385675 -0.22613540 -0.20250357 -0.18336564 -0.16793961 [49] -0.15544347 > (mypacf <- c(rpacf$acf)) [1] 0.961713328 -0.191242926 -0.030558102 -0.136914188 -0.054469964 [6] -0.089827079 0.090091261 -0.087775522 -0.008062646 0.037562642 [11] -0.060372403 -0.005146648 -0.039519452 0.072565556 -0.079345980 [16] 0.013387863 0.001968504 0.141584505 -0.050572934 -0.061233726 [21] -0.162998194 -0.057321804 0.051616988 -0.205525437 -0.082833805 [26] -0.071586122 -0.024542293 -0.022902604 -0.030717219 0.058516389 [31] -0.077455028 0.031863782 0.004913282 0.094595198 -0.020610318 [36] 0.075014555 -0.040624242 0.107704825 0.151244366 -0.084577827 [41] -0.009415820 -0.065939037 -0.120416090 -0.017278896 0.035858789 [46] -0.090205250 0.044206807 -0.002340315 > 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/39ece1241720153.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/4u1vs1241720153.tab") > > system("convert tmp/1gi0k1241720152.ps tmp/1gi0k1241720152.png") > system("convert tmp/23vla1241720152.ps tmp/23vla1241720152.png") > > > proc.time() user system elapsed 0.562 0.324 2.821