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(101.0,98.7,105.1,98.4,101.7,102.9,92.2,94.9,92.8,98.5,94.3,87.4,103.4,101.2,109.6,111.9,108.9,105.6,107.8,97.5,102.4,105.6,99.8,96.2,113.1,107.4,116.8,112.9,105.3,109.3,107.9,101.1,114.7,116.2,108.4,113.4,108.7,112.6,124.2,114.9,110.5,121.5,118.1,111.7,132.7,119.0,116.7,120.1,113.4,106.6,116.3,112.6,111.6,125.1,110.7,109.6,114.2,113.4,116.0,109.6,117.8,115.8,125.3,113.0,120.5,116.6,111.8,115.2,118.6,122.4,116.4,114.5,119.8,115.8,127.8,118.8,119.7,118.6,120.8,115.9,109.7,114.8,116.2,112.2) > par7 = '' > 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: Write here your technical program description (don't use hard returns!) > 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 (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/11coq1261341805.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/29ks91261341805.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.0000000000 0.6498385653 0.6189072905 0.6588146593 0.4967817797 [6] 0.4914140253 0.5456840339 0.4082955816 0.4151075078 0.4778812211 [11] 0.3242509119 0.3587364240 0.4203003754 0.2165478025 0.2597604540 [16] 0.2274107538 0.1808761769 0.2243323541 0.2241227264 0.1189344498 [21] 0.1899034848 0.1268512099 0.0275097573 0.0835718275 0.0662705781 [26] -0.0003322597 0.0285852125 0.0067791621 0.0064800587 0.0257613723 [31] -0.0018767309 -0.0743327312 -0.0638988200 -0.1415460548 -0.1509313890 [36] -0.1342695471 -0.1247848938 -0.1583703893 -0.1729293571 -0.1803573740 [41] -0.1738176668 -0.1947904213 -0.1958429659 -0.1889009858 -0.1759037444 [46] -0.1768799998 -0.1675519998 -0.1837320576 -0.1162648576 -0.1648589614 [51] -0.1911457036 -0.2221693404 -0.2192659931 -0.2281568055 -0.2270932855 [56] -0.2286545007 -0.2351157155 -0.2225887170 -0.2285721053 -0.2295505113 [61] -0.2012569923 > (mypacf <- c(rpacf$acf)) [1] 0.649838565 0.340338897 0.337397352 -0.111258177 0.034552595 [6] 0.186009508 -0.084396021 0.003988324 0.147115114 -0.127732552 [11] 0.025095807 0.129380266 -0.238860538 -0.020959171 -0.103944735 [16] 0.166631117 0.045833063 -0.014366467 -0.079779100 0.066561174 [21] -0.133100378 -0.066743458 -0.023716879 0.082973419 0.011969223 [26] -0.089482459 0.055319925 0.056073601 -0.055472095 -0.016976422 [31] -0.069599153 -0.106626633 -0.087084821 0.016308243 0.041248319 [36] 0.043435779 -0.086924957 -0.047681050 0.025597413 0.017983498 [41] -0.061623846 0.039826047 0.100406710 0.028642942 -0.025786700 [46] -0.036420117 -0.058694839 0.077567042 -0.040654030 -0.034215292 [51] -0.159436543 -0.021420910 0.043661003 -0.049409243 -0.044481507 [56] -0.047663791 0.019038092 0.063243459 -0.012020351 -0.055622343 > 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/3nhzt1261341805.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/47vvk1261341805.tab") > try(system("convert tmp/11coq1261341805.ps tmp/11coq1261341805.png",intern=TRUE)) character(0) > try(system("convert tmp/29ks91261341805.ps tmp/29ks91261341805.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.597 0.307 0.712