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(7.4,7.2,7.1,6.9,6.8,6.8,6.8,6.9,6.7,6.6,6.5,6.4,6.3,6.3,6.3,6.5,6.6,6.5,6.4,6.5,6.7,7.1,7.1,7.2,7.2,7.3,7.3,7.3,7.3,7.4,7.6,7.6,7.6,7.7,7.8,7.9,8.1,8.1,8.1,8.2,8.2,8.2,8.2,8.2,8.2,8.3,8.3,8.4,8.4,8.4,8.3,8,8,8.2,8.6,8.7,8.7,8.5,8.4,8.4,8.4,8.5,8.5,8.5,8.5,8.5,8.4,8.4,8.4,8.5,8.6,8.6,8.6,8.6,8.5,8.4,8.4,8.3,8.2,8.1,8.2,8.1,8,7.9,7.8,7.7,7.7,7.9,7.8,7.6,7.4,7.3,7.1,7.1,7,7,7,6.9,6.8,6.7,6.6,6.6) > par5 = '12' > par4 = '0' > par3 = '1' > 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/1bk8k1228576536.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/2t7bq1228576536.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.433282855 0.135918457 -0.124470303 -0.036005093 [6] 0.110121932 0.255672338 0.269609655 0.242174621 0.257265174 [11] 0.091513865 0.019823389 -0.138648116 -0.028343493 0.146902747 [16] 0.210068837 0.129368703 0.050398423 0.007827163 -0.028617529 [21] -0.043799428 -0.118372995 -0.097155874 0.004715709 0.078044694 [26] 0.027040393 0.063393740 -0.081671393 -0.117539468 -0.147280974 [31] -0.199438511 -0.046608301 0.076526076 0.235482853 0.125663503 [36] -0.107912514 -0.319649119 -0.181378517 -0.043107915 0.087306266 [41] 0.138219221 0.042959478 -0.059003450 -0.117287554 -0.196834452 [46] -0.203583311 -0.094431924 0.028125834 0.098571728 0.046414192 [51] -0.047692314 -0.131635926 -0.160224196 -0.175982713 -0.069137799 [56] -0.063056904 -0.077662185 -0.033452415 -0.127558921 -0.120324790 [61] -0.127650267 > (mypacf <- c(rpacf$acf)) [1] 0.433282855 -0.063791391 -0.197139980 0.130592178 0.141694126 [6] 0.140736684 0.108894874 0.131157795 0.216762458 -0.075424826 [11] -0.014302948 -0.171408168 0.011206725 0.104561759 -0.072133376 [16] -0.055398565 0.047880570 0.044102402 -0.034570131 -0.081940726 [21] -0.094774610 -0.074271948 0.011091216 -0.025756915 -0.074692703 [26] 0.214586015 -0.067956765 -0.064364471 -0.021843209 -0.159786549 [31] 0.139111957 0.034950218 0.174549703 0.025717958 -0.174647499 [36] -0.032199650 0.049285660 0.019627699 -0.001713302 -0.014985443 [41] -0.001617066 -0.147261735 0.004871383 -0.093760243 -0.031025243 [46] 0.035229215 -0.088404279 0.003938923 0.002245373 0.080228893 [51] 0.020732295 -0.160204715 -0.003334651 0.047532832 -0.106812382 [56] -0.075140942 -0.051039093 -0.081632651 0.009369915 -0.022872518 > 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/30p3b1228576536.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/4jg191228576536.tab") > > system("convert tmp/1bk8k1228576536.ps tmp/1bk8k1228576536.png") > system("convert tmp/2t7bq1228576536.ps tmp/2t7bq1228576536.png") > > > proc.time() user system elapsed 0.604 0.301 1.410