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(268,267,266,264,284,283,268,258,259,259,260,262,255,259,258,258,288,289,271,268,274,284,284,279,273,280,276,271,298,297,278,270,280,289,288,293,285,283,275,268,295,290,267,252,268,278,280,278,261,263,259,265,294,285,255,231,246,258,265,260,238,241,239,233,265,255,224,194,210,222,230,225,206,204,207,195,230,221,195,162,182,203,211,206,187,181,189,174,213,201,177,140,165,192,197,196,176,164,177,165,208,195,164,123,147,173,176,170,157,145,148,135,175,168,140,109,129,150,150,152) > 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/rcomp/tmp/1vjy91281961111.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/2vjy91281961111.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.929355946 0.850267864 0.816644631 0.829665302 [6] 0.839045734 0.831861575 0.800767402 0.748126354 0.690746879 [11] 0.685885634 0.720581812 0.752235240 0.685485755 0.611042663 [16] 0.578718737 0.585167873 0.585279273 0.574019958 0.544280818 [21] 0.496487137 0.443176533 0.433020015 0.453045044 0.472649819 [26] 0.412535557 0.341373205 0.309595231 0.309862079 0.302482248 [31] 0.285634781 0.253032641 0.206340501 0.155059933 0.139940406 [36] 0.150619727 0.158463700 0.101698893 0.034298707 0.003264032 [41] 0.001000982 -0.008419779 -0.026922700 -0.055142559 -0.092557707 [46] -0.133747591 -0.148097422 -0.141109877 -0.135701108 > (mypacf <- c(rpacf$acf)) [1] 0.929355946 -0.098568268 0.297535504 0.305090125 0.064783445 [6] 0.101257861 -0.069371414 -0.207951131 -0.197935237 0.208959155 [11] 0.200987019 0.217039177 -0.539294480 0.081774449 0.027721732 [16] -0.010172490 -0.080383590 -0.009552990 0.018377436 0.036611770 [21] 0.014975354 -0.072003058 -0.011515832 0.054605511 -0.151342901 [26] -0.064685822 0.015236840 -0.039743849 -0.010920369 -0.025881629 [31] -0.049280965 0.009763968 0.021395473 -0.063791784 -0.005710976 [36] -0.052871718 -0.058436535 -0.022911445 -0.022488741 -0.030220944 [41] 0.010980263 -0.021815332 0.025965372 0.030236952 -0.007266053 [46] -0.085817892 -0.015530525 -0.017385302 > 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/39be01281961111.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/4kkdl1281961111.tab") > > try(system("convert tmp/1vjy91281961111.ps tmp/1vjy91281961111.png",intern=TRUE)) character(0) > try(system("convert tmp/2vjy91281961111.ps tmp/2vjy91281961111.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.548 0.334 2.785