R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(668,667,666,664,684,683,668,658,659,659,660,662,659,655,655,655,674,674,665,644,638,648,641,637,651,649,652,650,661,666,652,624,613,623,615,613,621,612,611,609,631,632,624,596,584,587,581,574,593,582,571,572,594,588,571,546,535,537,527,515,545,538,520,523,541,529,504,473,455,458,450,442,469,455,439,443,461,451,425,393,366,359,351,343,366,355,344,351,367,364,353,313,278,274,261,255,274,262,265,274,291,289,277,238,203,198,190,187,201,181,181,196,207,202,186,154,120,107,99,100) > 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/rcomp/tmp/10gvr1282068001.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/rcomp/tmp/20gvr1282068001.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.97218590 0.94160437 0.91205950 0.88399082 0.85840050 [7] 0.83657641 0.81712212 0.79906518 0.77979296 0.75923296 0.73894686 [13] 0.71820462 0.68984787 0.65952932 0.62998851 0.60090956 0.57439083 [19] 0.55222828 0.53174744 0.51279621 0.49239066 0.47097827 0.44994530 [25] 0.42830342 0.39872255 0.36774253 0.33774651 0.30813345 0.28149904 [31] 0.25896386 0.23811038 0.21896699 0.19867495 0.17783711 0.15892929 [37] 0.13957432 0.11318099 0.08628680 0.05994212 0.03425466 0.01030268 [43] -0.01007238 -0.02755819 -0.04270524 -0.05921900 -0.07561433 -0.08971333 [49] -0.10335848 > (mypacf <- c(rpacf$acf)) [1] 0.9721859014 -0.0645536084 0.0056714168 0.0095840460 0.0282648134 [6] 0.0517481999 0.0271151826 0.0153244979 -0.0286564461 -0.0245147761 [11] 0.0029326745 -0.0153570359 -0.1488022592 -0.0425343817 -0.0090010584 [16] -0.0200291598 0.0167984141 0.0431835437 -0.0006932399 0.0104587354 [21] -0.0293036560 -0.0116757641 0.0044962398 -0.0183051895 -0.1421421523 [26] -0.0331285419 -0.0128198178 -0.0257781067 0.0138169116 0.0199977652 [31] -0.0089095296 0.0071752660 -0.0201987510 0.0001235050 0.0312438971 [36] -0.0174212577 -0.1127970912 -0.0156547533 -0.0215956989 -0.0161056409 [41] -0.0163865892 0.0007222148 0.0090152815 0.0112215863 -0.0233421408 [46] 0.0134845057 0.0307514529 0.0014336812 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/34ycf1282068001.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/rcomp/tmp/4pza31282068001.tab") > > try(system("convert tmp/10gvr1282068001.ps tmp/10gvr1282068001.png",intern=TRUE)) character(0) > try(system("convert tmp/20gvr1282068001.ps tmp/20gvr1282068001.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.760 0.770 2.039