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(12.5,14.8,15.9,14.8,12.9,14.3,14.2,15.9,15.3,15.5,15.1,15,12.1,15.8,16.9,15.1,13.7,14.8,14.7,16,15.4,15,15.5,15.1,11.7,16.3,16.7,15,14.9,14.6,15.3,17.9,16.4,15.4,17.9,15.9,13.9,17.8,17.9,17.4,16.7,16,16.6,19.1,17.8,17.2,18.6,16.3,15.1,19.2,17.7,19.1,18,17.5,17.8,21.1,17.2,19.4,19.8,17.6,16.2,19.5,19.9,20,17.3,18.9,18.6,21.4,18.6,19.8,20.8,19.6,17.7,19.8,22.2,20.7,17.9,21.2,21.4,21.7,23.2,21.5,22.9,23.2,18.6) > par5 = '12' > par4 = '1' > 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/1g01a1229516894.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/2j1pu1229516894.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.0920018239 0.2783591386 0.5343434436 0.1095575958 [6] 0.1595719577 0.3327981603 -0.0780358809 0.1078217039 0.1986412402 [11] -0.0921723243 -0.0335366073 0.0446637354 -0.1448224980 -0.0555488738 [16] -0.0217188513 -0.2563737536 0.0099179868 -0.0211884275 -0.1829294987 [21] -0.0045922382 0.0407315702 -0.2108308577 0.1929251804 -0.1929020556 [26] -0.0430372064 0.0940012441 -0.1015528468 -0.0661586294 0.0917628397 [31] -0.1333037506 0.0003097223 0.0383325999 -0.1530550445 0.0149605606 [36] 0.0997894334 -0.0677655677 0.0694516480 0.1283412927 0.0092661786 [41] 0.1345731668 0.1183205104 0.0360771092 0.1342483619 0.1878258380 [46] -0.0672509500 0.1736784862 0.0160876103 -0.0510745137 0.1143611854 [51] -0.0905476040 -0.1199577809 0.0434058677 -0.1538789948 -0.1613538766 [56] -0.0561660922 -0.1912264663 -0.1568662427 -0.0983442853 -0.2096939014 [61] -0.1260554420 > (mypacf <- c(rpacf$acf)) [1] 0.0920018239 0.2721987849 0.5344490761 0.0557073559 -0.1574847996 [6] 0.0187432116 -0.2080880911 -0.0489322305 0.1348759308 0.0574973458 [11] -0.1678578274 -0.1646186058 -0.0501079493 0.0414435319 0.0898396943 [16] -0.1344417070 0.0554070738 0.0891977319 0.0133577360 -0.0291469989 [21] 0.0970617421 -0.1457937313 0.1499356625 -0.2671073407 0.0709727723 [26] 0.0114880571 0.0058529727 -0.0329734890 -0.0094434331 -0.0333682285 [31] -0.0320311795 0.0001209750 -0.0181911529 0.0985761027 0.1318576418 [36] 0.0890030381 0.0687682662 -0.0481892273 0.0462068458 -0.0656517000 [41] 0.0240003337 0.0397117333 0.0396550328 -0.0080427589 -0.1182985598 [46] -0.1195880540 -0.0368963372 -0.1114688875 0.1342498563 -0.0285582163 [51] -0.0011684737 -0.0963038288 0.0014826166 -0.0360962017 -0.0063021591 [56] -0.0007020337 -0.0432204138 -0.0763375926 -0.0225813857 0.0437428701 > 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/398341229516895.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/4pa2w1229516895.tab") > > system("convert tmp/1g01a1229516894.ps tmp/1g01a1229516894.png") > system("convert tmp/2j1pu1229516894.ps tmp/2j1pu1229516894.png") > > > proc.time() user system elapsed 0.582 0.304 0.686