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(92.66,94.2,94.37,94.45,94.62,94.37,93.43,94.79,94.88,94.79,94.62,94.71,93.77,95.73,95.99,95.82,95.47,95.82,94.71,96.33,96.5,96.16,96.33,96.33,95.05,96.84,96.92,97.44,97.78,97.69,96.67,98.29,98.2,98.71,98.54,98.2,96.92,99.06,99.65,99.82,99.99,100.33,99.31,101.1,101.1,100.93,100.85,100.93,99.6,101.88,101.81,102.38,102.74,102.82,101.72,103.47,102.98,102.68,102.9,103.03,101.29) > par5 = '6' > par4 = '0' > par3 = '1' > par2 = '-1.2' > 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/1k8hw1228567881.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/2vyq71228567881.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.374988001 -0.021437301 -0.023739515 -0.012962149 [6] -0.426130128 0.824364834 -0.372738915 -0.021694380 -0.051243551 [11] -0.012512488 -0.372767967 0.749898254 -0.289410410 0.020040548 [16] -0.027472204 -0.028186141 -0.352894728 0.632466977 -0.276227478 [21] 0.002742537 -0.023871887 -0.052658411 -0.321786254 0.566635509 [26] -0.201905224 0.040517961 -0.010534536 -0.045142956 -0.246434426 [31] 0.456312264 -0.193842647 0.013522563 -0.019164933 -0.052214136 [36] -0.218647885 0.377950421 -0.128901154 0.030819628 0.018107560 [41] -0.017585837 -0.160131959 0.268838177 -0.112811325 0.009696281 [46] 0.013953661 -0.024038252 -0.138667697 0.174633871 -0.045284618 [51] 0.013522655 0.033217653 -0.002199696 -0.082239614 0.087916085 [56] -0.004234940 -0.014525751 0.003736930 -0.002315875 -0.055349001 > (mypacf <- c(rpacf$acf)) [1] -0.3749880008 -0.1885691406 -0.1254850832 -0.0936549614 -0.5904708954 [6] 0.6716132301 -0.2196960734 -0.0658795701 -0.2145926496 -0.1874789751 [11] 0.0968124649 0.0523276645 0.1666556793 0.0214016460 0.0735666474 [16] -0.0783803532 -0.0306455019 -0.0586621769 -0.0839311344 -0.0480019371 [21] -0.0358067926 -0.0598592048 -0.0653525922 -0.0305200138 0.0319628395 [26] 0.0503788029 -0.0922706896 0.0076547557 0.1408309023 -0.0915903752 [31] -0.0219713219 -0.1768081497 0.0037383388 0.0669865139 -0.1048142302 [36] 0.0152777632 -0.0014916113 0.0370128975 0.0470721252 0.0441172569 [41] 0.0869093404 -0.1510422364 -0.0192496840 -0.0274039571 0.0598489671 [46] 0.0770286875 -0.0749211376 0.0008835372 0.1208552974 -0.0376931046 [51] 0.0381015375 -0.0101905125 0.0342033319 -0.0261981847 -0.0228664794 [56] 0.0682651703 -0.0731677011 0.0441184662 -0.0194033448 > 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/3ubfu1228567881.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/4hlgj1228567881.tab") > > system("convert tmp/1k8hw1228567881.ps tmp/1k8hw1228567881.png") > system("convert tmp/2vyq71228567881.ps tmp/2vyq71228567881.png") > > > proc.time() user system elapsed 0.594 0.311 0.834