R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(17848,19592,21092,20889,25890,24965,22225,20977,22897,22785,22769,19637,20203,20450,23083,21738,26766,25280,22574,22729,21378,22902,24989,21116,15169,15846,20927,18273,22538,15596,14034,11366,14861,15149,13577,13026,13190,13196,15826,14733,16307,15703,14589,12043,15057,14053,12698,10888,10045,11549,13767,12424,13116,14211,12266,12602,15714,13742,12745,10491,10057,10900,11771,11992,11993,14504,11727,11477,13578,11555,11846,11397,10066,10269,14279,13870,13695,14420,11424,9704,12464,14301,13464,9893,11572,12380,16692,16052,16459,14761,13654,13480,18068,16560,14530,10650,11651,13735,13360,17818,20613,16231,13862,12004,17734,15034,12609,12320,10833,11350,13648,14890,16325,18045,15616,11926,16855,15083,12520,12355) > par7 = '0.95' > par6 = 'White Noise' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/1yd4q1291369305.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2yd4q1291369305.ps",horizontal=F,onefile=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.1226161646 -0.1936194434 -0.2026778444 -0.0121031656 [6] -0.0021059831 0.2321310555 0.0151421933 -0.1271091418 -0.1852868737 [11] -0.0710271755 -0.0416102084 0.5172389687 -0.0191016506 -0.0678782145 [16] -0.2341361336 0.0363189296 -0.0441741714 0.2194663860 0.0007090323 [21] -0.0842394609 -0.1845522618 -0.0445258996 0.0346904509 0.3238570135 [26] -0.0176660065 -0.1341824601 -0.1170437187 0.0543424213 -0.0774673405 [31] 0.1598722228 -0.0355001188 -0.0371471035 -0.1316406137 -0.0313639568 [36] 0.0345713717 0.2516080780 0.0432853417 -0.1890256142 -0.0003541382 [41] 0.0322488472 -0.1156751007 0.1495665819 -0.0218363733 -0.0535625017 [46] -0.1343467458 0.0289343072 -0.0349796500 0.2487796533 > (mypacf <- c(rpacf$acf)) [1] -0.122616165 -0.211839110 -0.273631663 -0.156732159 -0.168194900 [6] 0.116763881 0.031932113 -0.061081822 -0.154401141 -0.199448241 [11] -0.278084054 0.348659937 0.068313314 0.187541136 -0.001022955 [16] 0.061670549 -0.091877722 0.003081099 -0.058916718 0.016543175 [21] -0.028110498 -0.026954671 0.033837113 0.065597892 -0.002636035 [26] -0.153343923 0.021649343 -0.036648991 -0.074647102 -0.069245286 [31] -0.093781000 -0.037467311 -0.012427599 -0.087222764 -0.019743729 [36] 0.037387381 0.086946035 -0.072289789 0.136802100 0.017923510 [41] -0.094019825 0.027221086 -0.041396280 -0.003702148 -0.049948272 [46] -0.012479505 -0.110012542 0.099642619 > 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/3jdkw1291369305.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/4nwjk1291369305.tab") > > try(system("convert tmp/1yd4q1291369305.ps tmp/1yd4q1291369305.png",intern=TRUE)) character(0) > try(system("convert tmp/2yd4q1291369305.ps tmp/2yd4q1291369305.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.556 0.320 1.242