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(7089,77102,35123,23109,11115,48105,7896,79102,2494,76101,9484,8183,9092,49109,27127,31116,77120,80115,67117,18110,3099,3105,5786,7387,5089,288,65108,44100,68102,8798,8183,288,3680,9374,2271,4671,3466,8068,2780,9883,6479,3373,6468,460,5553,6157,2345,3744,6144,9948,2049,9549,6049,745,9643,9938,5535,6932,1827,9726,7624,9529,7631,6132,7534,2137,8738,8836,3230,633,9126,123) > par7 = '0.95' > par6 = 'White Noise' > 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: > 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/freestat/rcomp/tmp/18imn1272716338.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/freestat/rcomp/tmp/28imn1272716338.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.351624864 0.438807000 0.045181333 0.204670511 [6] -0.005290876 0.128272999 0.050502835 0.279623983 0.304389785 [11] 0.349761367 0.336314370 0.245423192 0.138201745 0.073572234 [16] 0.126614869 0.041364397 0.096972184 -0.052010169 0.108235512 [21] -0.047394122 0.095355513 -0.056964035 -0.003173988 -0.056779314 [26] 0.031892245 -0.003787714 -0.008146167 -0.091358505 -0.109479686 [31] -0.113719699 -0.101456844 -0.089988757 -0.093089388 -0.109884726 [36] -0.102048406 -0.113674310 -0.124863331 -0.101027277 -0.120811787 [41] -0.128526505 -0.143504364 -0.125906638 -0.142680422 -0.105509154 [46] -0.115545896 -0.086479690 -0.091082313 -0.089915236 > (mypacf <- c(rpacf$acf)) [1] 0.3516248640 0.3596318530 -0.2360108953 0.1284098961 -0.0216254464 [6] 0.0251484024 0.0854052757 0.2272078678 0.2256304119 0.0434970294 [11] 0.1585461039 -0.0025361421 -0.0991024534 0.0145540222 0.1359857514 [16] -0.0914784252 -0.0622070092 -0.1922228015 -0.0321771744 -0.2012923442 [21] -0.0427100873 -0.0321856409 -0.2158058294 0.0057407825 0.0176901996 [26] 0.0008085078 -0.0324805985 -0.0126039295 0.0233204401 -0.0082440435 [31] 0.0947272095 0.1130668879 0.0207916297 -0.0373702620 0.0369947801 [36] -0.0872779999 -0.0184163723 0.0631227788 0.0330271590 -0.1404376131 [41] -0.1152855205 -0.0144194267 -0.1273183726 0.0310069191 0.0755066766 [46] -0.0245624861 -0.0479445752 0.0221649217 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3mrkv1272716338.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/freestat/rcomp/tmp/4x12g1272716338.tab") > > try(system("convert tmp/18imn1272716338.ps tmp/18imn1272716338.png",intern=TRUE)) character(0) > try(system("convert tmp/28imn1272716338.ps tmp/28imn1272716338.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.805 0.425 0.938