R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(94.20,95.20,95.00,94.00,92.20,91.00,91.20,103.40,105.00,104.60,103.80,101.80,102.40,103.80,103.40,102.00,101.80,100.20,101.40,113.80,116.00,115.60,113.00,109.40,111.00,112.40,112.20,111.00,108.80,107.40,108.60,118.80,122.20,122.60,122.20,118.80,119.00,118.20,117.80,116.80,114.60,113.40,113.80,124.20,125.80,125.60,122.40,119.00,119.40,118.60,118.00,116.00,114.80,114.60,114.60,124.00,125.20,124.00,117.60,113.20,111.40,112.20,109.80,106.40,105.20,102.20,99.80,111.00,113.00,108.40,105.40,102.00,102.80) > 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/1ub7k1228330698.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/2himb1228330698.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.8881904574 0.7365351486 0.6144498131 0.5435337204 [6] 0.5207415723 0.4833791434 0.4027548532 0.3490572350 0.3422026180 [11] 0.3772007045 0.4321645046 0.4471596780 0.3358584697 0.1951661788 [16] 0.0798867261 0.0176801621 0.0002828929 -0.0287161582 -0.0857095957 [21] -0.1168911520 -0.1111650720 -0.0732289480 -0.0280173757 -0.0187451402 [26] -0.1008106185 -0.2062055675 -0.2849415347 -0.3207358533 -0.3263938032 [31] -0.3406735902 -0.3769629510 -0.3903781912 -0.3676981884 -0.3190148600 [36] -0.2608418246 -0.2290934961 -0.2696022069 -0.3292536226 -0.3636460758 [41] -0.3608378180 -0.3369651173 -0.3219981899 -0.3329578810 -0.3224268557 [46] -0.2862662555 -0.2308495053 -0.1733416337 -0.1323312271 -0.1441151269 [51] -0.1712302858 -0.1756201230 -0.1559922491 -0.1195322975 -0.0848796235 [56] -0.0778649387 -0.0475323216 -0.0023971795 0.0466203923 0.0867218525 [61] 0.1145503670 > (mypacf <- c(rpacf$acf)) [1] 0.888190457 -0.247952385 0.092303837 0.124209310 0.133118868 [6] -0.122648288 -0.143374831 0.205047154 0.129766610 0.095615312 [11] 0.099047085 -0.039352775 -0.520824106 -0.087421510 -0.016961358 [16] 0.019655591 0.005162229 0.068887785 0.056104769 -0.030421952 [21] -0.055892978 -0.031589827 -0.029491152 -0.007348974 -0.146876192 [26] -0.019180850 0.038974014 -0.056209940 -0.096082974 0.014322644 [31] -0.009687695 -0.072468785 -0.010010579 0.034379804 0.061436904 [36] 0.004567016 -0.076385567 -0.006125427 0.018167968 -0.029508986 [41] -0.064414173 0.058156857 -0.013109277 -0.024815762 -0.075138215 [46] 0.030653820 -0.036223501 0.028504091 0.001871435 0.028657453 [51] 0.059419302 -0.058136347 -0.003082228 0.080562942 -0.017370124 [56] 0.039968608 -0.029460093 0.003199591 -0.093038536 0.008839165 > 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/343rv1228330699.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/49yyz1228330699.tab") > > system("convert tmp/1ub7k1228330698.ps tmp/1ub7k1228330698.png") > system("convert tmp/2himb1228330698.ps tmp/2himb1228330698.png") > > > proc.time() user system elapsed 0.574 0.312 0.711