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(462,455,461,461,463,462,456,455,456,472,472,471,465,459,465,468,467,463,460,462,461,476,476,471,453,443,442,444,438,427,424,416,406,431,434,418,412,404,409,412,406,398,397,385,390,413,413,401,397,397,409,419,424,428,430,424,433,456,459,446) > par7 = '0.95' > par6 = 'White Noise' > 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: > 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/1e82n1259922480.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/23uz81259922480.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.935977401 0.852066258 0.799646319 0.774287941 [6] 0.758975666 0.721206041 0.646132366 0.550092436 0.470132089 [11] 0.417343620 0.401568256 0.363148854 0.254783749 0.145805234 [16] 0.067950605 0.017347863 -0.016106071 -0.058613257 -0.124029970 [21] -0.208224784 -0.268956064 -0.302886421 -0.311425730 -0.336164636 [26] -0.394856873 -0.445894821 -0.464463260 -0.460552530 -0.440402196 [31] -0.419205671 -0.412944343 -0.416554552 -0.394459733 -0.364270570 [36] -0.330425192 -0.303191550 -0.299563279 -0.294937307 -0.280158553 [41] -0.254479044 -0.221592575 -0.188572755 -0.168017522 -0.148543636 [46] -0.122748961 -0.101148749 -0.077965310 -0.054532142 -0.041139015 [51] -0.029880700 -0.018055042 -0.004427947 0.007109191 0.014397313 [56] 0.016559946 0.020837996 0.023725568 0.015602069 0.004693980 > (mypacf <- c(rpacf$acf)) [1] 0.9359774008 -0.1935308748 0.2424759843 0.1087896306 0.0768438387 [6] -0.1518178388 -0.2340424120 -0.2137741750 -0.0361666807 -0.0033494956 [11] 0.2738366691 -0.1811001312 -0.4251713552 0.0846818750 -0.0289481703 [16] -0.0519805263 0.0474000458 0.0172855564 0.0484042555 -0.1582850360 [21] 0.0931919919 -0.1199397363 -0.0962065336 0.0088272806 0.0269687220 [26] -0.0004404039 0.1435686382 -0.0355645381 0.0947457938 0.0053167278 [31] 0.0870671881 -0.0107197676 0.0671410383 -0.2062142931 -0.0671497448 [36] 0.0130733289 -0.0727700179 -0.1205122595 -0.0701168603 -0.0002209694 [41] 0.0292269910 -0.0147215833 0.1486879050 0.0254648295 -0.1317496098 [46] 0.0415953277 0.0038661429 -0.0813644476 0.0310136524 -0.0436216004 [51] 0.0352724299 -0.0914712235 0.0151242016 -0.0530748317 -0.0535819896 [56] 0.0510767311 0.0763701862 -0.0410697249 0.0016634268 > 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/343tm1259922480.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/45s9q1259922480.tab") > > system("convert tmp/1e82n1259922480.ps tmp/1e82n1259922480.png") > system("convert tmp/23uz81259922480.ps tmp/23uz81259922480.png") > > > proc.time() user system elapsed 0.602 0.308 1.126