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(43.9,51,51.9,54.3,50.3,57.2,48.8,41.1,58,63,53.8,54.7,55.5,56.1,69.6,69.4,57.2,68,53.3,47.9,60.8,61.7,57.8,51.4,50.5,48.1,58.7,54,56.1,60.4,51.2,50.7,56.4,53.3,52.6,47.7,49.5,48.5,55.3,49.8,57.4,64.6,53,41.5,55.9,58.4,53.5,50.6,58.5,49.1,61.1,52.3,58.4,65.5,61.7,45.1,52.1,59.3,57.9,45,64.9,63.8,69.4,71.1,62.9,73.5,62.7,51.9,73.3,66.7,62.5,70.3) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '36' > #'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/1im8q1261047610.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/2tpom1261047610.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.351567135 -0.210194943 0.249082898 -0.117408855 [6] 0.002688504 0.039569449 -0.037500492 0.070296000 -0.118181676 [11] 0.145884530 0.046361731 -0.254068628 0.171499796 0.124558900 [16] -0.225013305 0.042140892 0.125689297 -0.075618871 -0.072320770 [21] 0.090577544 -0.053142529 -0.076949559 0.161760939 -0.034651848 [26] -0.179670300 0.172228438 0.103326900 -0.147079923 -0.102397473 [31] 0.100447315 0.011711654 0.039443963 0.053520530 -0.077700557 [36] 0.016678776 -0.049893708 > (mypacf <- c(rpacf$acf)) [1] -0.351567135 -0.380869676 0.017535286 -0.093791258 0.012643192 [6] -0.020738895 -0.004027871 0.068633637 -0.094445669 0.131438524 [11] 0.114630328 -0.122129838 0.007496868 0.132645713 -0.030802241 [16] -0.074234701 0.058388155 0.030862629 -0.083258466 0.007764109 [21] -0.088369235 -0.089283823 0.102591018 -0.012893164 -0.148886667 [26] 0.095958761 0.153677916 -0.009901897 -0.117994522 -0.042502236 [31] -0.066757768 0.180117496 0.181575870 -0.067764994 0.093796164 [36] -0.071729859 > 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/3inr41261047610.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/4qlus1261047610.tab") > try(system("convert tmp/1im8q1261047610.ps tmp/1im8q1261047610.png",intern=TRUE)) character(0) > try(system("convert tmp/2tpom1261047610.ps tmp/2tpom1261047610.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.538 0.323 0.859