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(9,8.8,8.7,8.7,8.6,8.6,8.5,8.5,8.3,8.2,8.1,7.8,7.5,7.4,7.3,7.7,7.7,7.6,7.3,7.2,7.5,8,8.1,8.4,8.6,8.7,8.6,8.4,8.4,8.5,8.9,8.8,8.7,8.6,8.6,8.6,8.8,8.8,8.8,8.8,8.7,8.7,8.9,8.9,9,8.9,9,9.1,9.3,9.4,9.4,9.2,9.2,9.4,9.9,10,9.9,9.6,9.5,9.6,9.5,9.6,9.6,9.5,9.5,9.5,9.5,9.4,9.5,9.5,9.5,9.5,9.5,9.4,9.3,9.2,9.3,9.4,9.5,9.6,9.5,9.3,9.1,9,9,8.9,9,9.2,9,8.7,8.3,8,7.7,7.9,7.9,7.8,7.7,7.5,7.3,7.2,7.1,7.1) > 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/1dtr21228575396.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/262nk1228575396.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.00000000 0.94998494 0.87877800 0.80703389 0.74928780 0.70482350 [7] 0.66257108 0.60921714 0.54622575 0.47332303 0.39047741 0.31467819 [13] 0.25535218 0.21593307 0.19143886 0.17431757 0.14526268 0.11062543 [19] 0.07598819 0.04053992 0.01207486 -0.00602597 -0.01584807 -0.02077243 [25] -0.03494455 -0.06000753 -0.09617203 -0.13544368 -0.16686844 -0.19020405 [31] -0.21079061 -0.23178795 -0.25568180 -0.28605328 -0.32433486 -0.36730351 [37] -0.39913904 -0.41533345 -0.42114257 -0.42659357 -0.43648940 -0.44856550 [43] -0.45995698 -0.45907780 -0.45232136 -0.43798133 -0.41176037 -0.38064168 [49] -0.35238790 -0.33837439 -0.33155474 -0.32187019 -0.30359092 -0.28011901 [55] -0.25607832 -0.23892606 -0.22696643 -0.22115793 -0.21541263 -0.21098392 [61] -0.20294248 > (mypacf <- c(rpacf$acf)) [1] 0.9499849444 -0.2429378668 0.0020106083 0.1049888233 0.0501092746 [6] -0.0496325880 -0.1319816895 -0.0665007682 -0.1089826730 -0.1525036882 [11] 0.0240996187 0.0707429657 0.0926587876 0.0758170001 0.0737233732 [16] -0.0994685670 -0.0028996793 -0.0119136858 -0.1109424077 -0.0445032283 [21] 0.0001557390 0.0174041414 0.0212224623 -0.0821407852 -0.0079885827 [26] -0.0834710159 -0.0636505268 0.0104598982 -0.0412746759 -0.0701072980 [31] -0.0163674022 -0.0116219231 -0.0557273744 -0.0814015493 -0.0729348406 [36] 0.0484920828 0.0179998954 -0.0387650609 -0.0320613621 -0.0341821001 [41] -0.0007671211 -0.0127687794 0.0657528792 -0.0490421335 -0.0025457373 [46] 0.0707889156 0.0040827776 -0.0303868415 -0.1230789005 0.0012235977 [51] -0.0019742361 -0.0299301116 -0.0102622869 -0.0162200143 -0.0496494050 [56] 0.0053882296 -0.0071798388 0.0315315129 -0.0421755237 0.0050745446 > 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/3nqnh1228575396.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/4b39i1228575396.tab") > > system("convert tmp/1dtr21228575396.ps tmp/1dtr21228575396.png") > system("convert tmp/262nk1228575396.ps tmp/262nk1228575396.png") > > > proc.time() user system elapsed 0.641 0.355 0.810