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(1190.8,728.8,995.6,1260.3,994,957.3,975.6,884.9,908.4,1022.8,958.6,825.1,1116.6,724.2,1004.5,1058.9,854.7,943.4,792.4,873.2,1101.4,987.1,1038.8,1060.7,1047.7,840,1044,1097.4,987.5,934,977,881.1,1083.3,1074.7,1182.2,1117.5,1117.4,936.2,1246.3,1175.1,1177.7,1035.8,1091.6,998.7,1247.9,1034.7,1287.7,994.0,1122.8,1017.3,1106.0,1191.8,1030.1,989.4,979.6,1088.0,1389.2,1043.9,1182.1,1109.6,1463.3,1276.2,1082.4,1360.4,1130.2,1019.6,1077.0,958.8,959.6,907.2,880.8,759.6,1137.2) > par5 = '12' > par4 = '0' > 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/1t5j71228413864.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/2gup31228413864.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.499449460 0.016787850 0.010444333 -0.009633820 [6] -0.004118108 0.111931020 -0.094931804 -0.003690153 -0.070170294 [11] 0.117688050 -0.324313573 0.507578204 -0.317617081 0.117015919 [16] -0.115316389 0.014334614 0.076505440 0.109926488 -0.184259718 [21] 0.081886492 -0.067136292 0.066510296 -0.133309869 0.266627309 [26] -0.199227673 0.071391694 -0.080821278 0.051470795 0.004199580 [31] 0.066509605 -0.116114380 0.073136116 -0.141717177 0.160097150 [36] -0.171715208 0.206090429 -0.087295955 -0.060494343 0.021458861 [41] 0.031465982 0.063540622 -0.038239421 -0.043740009 0.071009900 [46] -0.169389281 0.224076059 -0.180034104 0.106208841 0.006616984 [51] -0.125115575 0.076687821 0.004314447 0.051591114 -0.007215678 [56] -0.079125980 -0.006577663 0.036494179 0.112276101 -0.218349235 [61] 0.129699381 > (mypacf <- c(rpacf$acf)) [1] -0.499449460 -0.309988462 -0.196624332 -0.142600607 -0.113082778 [6] 0.086698980 0.047441483 0.001886197 -0.141492719 -0.024029783 [11] -0.475134463 0.137486758 -0.039066724 0.182325735 -0.059881154 [16] -0.100049489 -0.038964489 0.097344706 -0.045837471 0.006057624 [21] 0.029090023 -0.082906335 -0.022235997 -0.027311003 0.121959496 [26] 0.007482593 0.051407696 0.037501069 0.023707488 -0.108900892 [31] -0.043889343 0.004637451 -0.113098193 0.025583673 -0.205134031 [36] 0.037206371 0.048844284 -0.073904251 0.006937186 -0.047707084 [41] 0.114444075 -0.121164693 0.035611862 -0.064428770 -0.052041092 [46] -0.051127943 0.019247002 -0.036884253 0.040634065 -0.034161630 [51] -0.007604133 0.061643145 -0.037378192 0.086645044 -0.063373230 [56] -0.124008104 0.025065147 0.038497465 -0.107512634 -0.039703763 > 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/3by571228413864.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/4vq1x1228413864.tab") > > system("convert tmp/1t5j71228413864.ps tmp/1t5j71228413864.png") > system("convert tmp/2gup31228413864.ps tmp/2gup31228413864.png") > > > proc.time() user system elapsed 0.587 0.308 0.767