R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(8,8.2,8.3,8.1,7.4,7.3,7.7,8,8,7.7,6.9,6.6,6.9,7.5,7.9,7.7,6.5,6.1,6.4,6.8,7.1,7.3,7.2,7,7,7,7.3,7.5,7.2,7.7,8,7.9,8,8,7.9,7.9,8,8.1,8.1,8.2,8,8.3,8.5,8.6,8.7,8.7,8.5,8.4,8.5,8.7,8.7,8.6,7.9,8.1,8.2,8.5,8.6,8.5,8.3,8.2,8.7,9.3,9.3,8.8,7.4,7.2,7.5,8.3,8.8,8.9,8.6,8.4,8.4,8.4,8.4,8.3,7.6,7.6,7.9,8,8.2,8.3,8.2,8.1,8,7.8,7.6,7.5,6.8,6.9,7.1,7.3,7.4,7.6,7.6,7.5,7.5,6.8,6.4,6.2,6,6.3,6.3,6.1,6.1,6.3,6.6,6.8,7,7.1,7.3,6.8,6.3,6.4,6.7,6.8,7.2,7.5,7.7,7.8,8.1) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/126z31260039145.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2k3z61260039145.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.0000000000 0.3831005615 -0.1863041510 -0.4661871516 -0.3719277732 [6] 0.0252721084 0.3452752739 0.2042572750 -0.1105121083 -0.2568134856 [11] -0.2056687021 0.0838591450 0.4870043739 0.1678239266 -0.0207073582 [16] -0.1365148572 -0.1595910228 -0.0334086555 0.0786991382 -0.0259538746 [21] -0.1283673288 -0.1164890590 -0.0875542619 0.0653419554 0.2902443099 [26] 0.0073917289 -0.0631234830 -0.0675655318 -0.0675717700 0.0007656465 [31] 0.0282651464 -0.0415138570 -0.1268769707 -0.0601047705 -0.0163158850 [36] 0.0757286814 0.2100959546 -0.0616207000 -0.1032010633 -0.0593998045 [41] 0.0274541829 0.1232540311 0.1136214033 -0.0801190204 -0.2931802762 [46] -0.2256656809 -0.0504790511 0.2360792156 0.4261384938 > (mypacf <- c(rpacf$acf)) [1] 0.383100562 -0.390362089 -0.300608110 -0.161205897 0.086299200 [6] 0.120360773 -0.161886821 -0.137564029 -0.008401438 -0.052246648 [11] 0.072096741 0.375909084 -0.339315491 0.343292600 0.123710195 [16] 0.002505957 -0.008924674 -0.093687963 -0.063284233 -0.065258518 [21] -0.138620871 -0.103275145 -0.020383725 0.001259611 -0.154044734 [26] -0.009808362 0.024992556 -0.044688877 -0.031634288 -0.064035897 [31] 0.098872009 -0.124501321 0.091001212 0.054281121 -0.021091597 [36] 0.085809788 -0.100887314 -0.024058302 0.008570731 0.058757446 [41] 0.027994510 0.033665177 -0.164887330 -0.160287469 -0.119993922 [46] -0.067985885 0.070091644 0.023324257 > 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/3shku1260039145.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/4wymq1260039145.tab") > > system("convert tmp/126z31260039145.ps tmp/126z31260039145.png") > system("convert tmp/2k3z61260039145.ps tmp/2k3z61260039145.png") > > > proc.time() user system elapsed 0.573 0.303 0.683