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(98.6,98,106.8,96.7,100.2,107.7,92,98.4,107.4,117.7,105.7,97.5,99.9,98.2,104.5,100.8,101.5,103.9,99.6,98.4,112.7,118.4,108.1,105.4,114.6,106.9,115.9,109.8,101.8,114.2,110.8,108.4,127.5,128.6,116.6,127.4,105,108.3,125,111.6,106.5,130.3,115,116.1,134,126.5,125.8,136.4,114.9,110.9,125.5,116.8,116.8,125.5,104.2,115.1,132.8,123.3,124.8,122,117.4,117.9,137.4,114.6,124.7,129.6,109.4,120.9,134.9,136.3,133.2,127.2,122.7,120.5,137.8,119.1,124.3,134.4,121.1,122.2,127.7,137.4,132.2,129.2,124.9,124.8,128.2,134.4,118.6,132.6,123.2,112.8,138.3) > par5 = '12' > par4 = '1' > 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/174zh1229782255.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/24rih1229782255.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.5117361014 -0.0348087499 0.1747935331 -0.1979044517 [6] 0.0594692728 0.1889790146 -0.2784630087 0.0342229655 0.2718119418 [11] -0.2450848920 0.0951681815 0.0003632856 -0.1972677611 0.2026539180 [16] -0.0013779892 -0.2126541789 0.2786371715 -0.0600629554 -0.1532014785 [21] 0.1132201295 0.0016564793 -0.1648858267 0.3754556993 -0.3347683698 [26] 0.0468722410 0.0748222233 0.0215024086 -0.0851962762 0.0708107790 [31] -0.0902148916 0.0257164741 0.1846257560 -0.2090769732 0.0215564973 [36] 0.0663034405 -0.0967282883 0.1379558848 0.0118139150 -0.1603367982 [41] 0.1271183739 -0.0258992808 -0.0806092141 0.0597246506 0.0644356089 [46] -0.1822169334 0.2273516926 -0.0878541069 -0.0837636021 0.1095344517 [51] -0.0426509254 -0.1253012565 0.2114549608 -0.1224655814 0.0066318363 [56] 0.1406576709 -0.1940804094 0.0484704569 0.0539829359 -0.0828760264 [61] 0.0533454617 > (mypacf <- c(rpacf$acf)) [1] -0.5117361014 -0.4019402135 -0.0902705254 -0.2095050285 -0.1884813688 [6] 0.1227229651 -0.0869768370 -0.2405226493 0.1413435169 0.1037832635 [11] 0.0550131206 -0.0146346159 -0.1571860730 -0.0991347789 -0.0793822806 [16] -0.2149251854 0.0485946833 0.1475732894 -0.0183450276 -0.1919084985 [21] 0.0369471837 -0.0752780245 0.2232880313 -0.0155855717 -0.0004092631 [26] -0.2805004401 -0.0161605124 -0.0562237313 -0.0064673559 0.0375952681 [31] 0.0041582998 -0.0148457421 0.0197551574 -0.0517802340 0.0417197812 [36] -0.0444269323 0.0872556876 0.0704503168 0.0547267229 -0.0842361068 [41] -0.0837829085 -0.0682465512 -0.0081433879 0.0495187808 -0.0261314753 [46] -0.0314281881 0.1218171157 -0.0479090097 0.0166829769 -0.0041870436 [51] -0.0175631895 0.0149364007 -0.0547711755 -0.0747348615 -0.0259523377 [56] -0.0086915536 0.0388739198 -0.0778020609 -0.0236542755 -0.0713412381 > 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/38nkn1229782255.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/4q1931229782255.tab") > > system("convert tmp/174zh1229782255.ps tmp/174zh1229782255.png") > system("convert tmp/24rih1229782255.ps tmp/24rih1229782255.png") > > > proc.time() user system elapsed 0.574 0.318 0.696