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 = '0' > 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/1xouf1291369075.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/2xouf1291369075.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.000000000 0.834379477 0.706562196 0.643438464 0.648729388 [6] 0.644533571 0.647404740 0.581793540 0.510002454 0.474836162 [11] 0.497701235 0.539860301 0.598064600 0.490228125 0.388542003 [16] 0.309290978 0.311319424 0.286920730 0.281033135 0.210574026 [21] 0.146229846 0.106390625 0.117630700 0.141205563 0.154584294 [26] 0.068247977 -0.007360927 -0.042375735 -0.034250007 -0.055688421 [31] -0.043972362 -0.080587646 -0.100045591 -0.112066895 -0.080836908 [36] -0.044210518 -0.019432554 -0.078927854 -0.147106806 -0.155895122 [41] -0.166178579 -0.193026451 -0.179291981 -0.208254248 -0.228351971 [46] -0.234342580 -0.195126664 -0.169866900 -0.131598231 > (mypacf <- c(rpacf$acf)) [1] 0.834379477 0.034143227 0.150063879 0.234636132 0.077013727 [6] 0.141723647 -0.133739070 -0.063183938 0.029161631 0.111289345 [11] 0.158115062 0.229705009 -0.388049601 -0.080419945 -0.200299268 [16] -0.004818766 -0.095954312 0.048316810 -0.048992237 0.039779905 [21] -0.031288412 -0.016768364 0.016394145 -0.070564493 -0.092838334 [26] -0.014746788 0.097645464 -0.041884904 0.010325384 0.068566210 [31] 0.040028912 0.072547083 0.004427774 0.015852765 0.075648656 [36] 0.005307950 -0.090756359 -0.104611332 0.021928515 -0.203588591 [41] -0.037879552 0.030757530 -0.068116692 -0.001179876 -0.017271818 [46] 0.001938234 -0.001612321 0.057906089 > 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/3tgro1291369075.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/4mp9r1291369075.tab") > > try(system("convert tmp/1xouf1291369075.ps tmp/1xouf1291369075.png",intern=TRUE)) character(0) > try(system("convert tmp/2xouf1291369075.ps tmp/2xouf1291369075.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.582 0.324 1.233