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(105.6,110.2,104.9,102.9,102.6,103.6,107.8,106.6,106,105.2,107.9,107.5,107.5,113.3,107.8,104.5,105.1,104.2,106.6,103.8,107.7,106.4,110,113.2,113.9,112,113.9,113.1,111.7,110.7,113.5,114,112.7,112.2,115.8,118.4,118.8,123.9,118,120.2,118.7,119.8,124.8,121.3,120.2,118.3,129.6,130.2,127.19,133.1,129.12,123.28,123.36,124.13,126.96,127.14,123.7,123.67,130.19,134.01,124.96,129.96,128.32,132.38,126.25,128.91,131.42,129.44,126.86,126.71,131.63,132.78,126.61,132.84,123.14,128.13,125.49,126.48,130.86,127.32,126.56,126.64,129.26,126.47,135.38,135.5,132.22,122.62,125.16,128.5,133.86,128.87,125.07,125.25,132.16,130.24) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > #'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/19u9c1228575641.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/2nfj91228575641.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.299744902 -0.108104405 -0.178463548 0.090482594 [6] 0.102059292 -0.096009283 0.053690953 -0.057957938 -0.023082370 [11] -0.043840551 -0.103222875 0.352233348 -0.021285813 -0.099930408 [16] -0.008390912 -0.038506077 0.110843970 -0.184506291 0.188936089 [21] -0.121100408 0.009859239 -0.122283699 0.096546499 0.210522987 [26] -0.144922721 0.019538469 0.026263966 -0.124640013 0.126148794 [31] -0.173688038 0.163118444 -0.064053697 -0.057299146 -0.129323961 [36] 0.041127476 0.344857536 -0.148606314 -0.058093222 -0.010721886 [41] -0.034943498 0.051352345 -0.026242375 0.060565746 -0.101940840 [46] 0.031114562 -0.099930818 0.018485424 0.161907984 > (mypacf <- c(rpacf$acf)) [1] -0.2997449024 -0.2174924578 -0.3264987894 -0.1569416037 -0.0173386174 [6] -0.1388861160 0.0005520842 -0.0475146065 -0.1147823669 -0.1418123638 [11] -0.3057806572 0.1484144805 0.1538727131 0.0417320579 0.2264499716 [16] 0.0759659409 0.0914125029 -0.1088388186 0.0911689471 -0.0244381474 [21] -0.0107041628 -0.1202528415 0.0688762893 0.1643553682 -0.0806648774 [26] 0.0852126279 0.1465870146 -0.2088185124 0.0098162242 -0.1258557078 [31] -0.0771243136 -0.0019874824 -0.1068616789 -0.2039465888 -0.1940679961 [36] -0.0269095955 0.0244688871 -0.0787446082 -0.0111905090 -0.0453267150 [41] -0.0876249651 -0.0166056836 0.0319835309 -0.0515033368 0.1572044250 [46] 0.0198430156 0.0623573052 -0.0182225564 > 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/3y54v1228575641.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/4vwj21228575641.tab") > > system("convert tmp/19u9c1228575641.ps tmp/19u9c1228575641.png") > system("convert tmp/2nfj91228575641.ps tmp/2nfj91228575641.png") > > > proc.time() user system elapsed 0.579 0.314 0.688