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(78.1,66.7,79,65.2,66.5,77.2,80.2,77.9,78,86.8,92.9,185.8,91,79.1,84.2,70.1,71.3,79.6,92.3,78.7,82.5,98.2,115.4,205.6,94,83.2,80.3,70.4,71.1,78.8,86.3,77.5,80.1,89.8,99.9,218,85.4,77.5,78.6,68.8,64.8,79.8,94.3,79.9,87.5,99.1,109.9,273.6,91.3,80.6,80.4,71.8,75.5,86.6,91.5,86.8,84.6,88.6,102.1,260.3,79,70.6,79.3,66.8,61.2,72.5,83.5,75.8,83.4,89.4,104.9,251.6,80,76.3,81.1,63.1,63.5,78.8,91.7,83.8,83.8,95.8,108.9,258.2,88.7,79.5,74.3,70.5,59.1,73.2,81.2,75,74.6,89.5,107,246.4,83.6,72.1,68.7,60.1,61.1,72.7,85.3,71.4,75.2,89.8,100.9,222.7) > 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/1280w1289833272.ps",horizontal=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/2280w1289833272.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.3884289990 -0.0447565430 0.0095757253 -0.0576048935 [6] 0.0103129795 0.0058334612 0.0123977923 -0.0617451447 0.0113254246 [11] -0.0566110578 -0.3938613457 0.9020143653 -0.3501292749 -0.0368275347 [16] 0.0076436008 -0.0496203798 0.0100950111 0.0048824386 0.0086487230 [21] -0.0597927382 0.0178086137 -0.0541362286 -0.3496621078 0.7882913368 [26] -0.3017430153 -0.0308753313 0.0055860807 -0.0445451020 0.0102452170 [31] 0.0057991841 0.0121658536 -0.0542151283 0.0169889005 -0.0483979437 [36] -0.2915838556 0.6578457728 -0.2492143413 -0.0232755024 0.0001088551 [41] -0.0345621076 0.0099255079 0.0066038299 0.0057298377 -0.0457538106 [46] 0.0152309579 -0.0434903063 -0.2235302084 0.5007226041 > (mypacf <- c(rpacf$acf)) [1] -0.3884289990 -0.2303949491 -0.1259952248 -0.1449506800 -0.1058356290 [6] -0.0741696890 -0.0371398802 -0.1061820301 -0.0916083693 -0.1577287905 [11] -0.7029371861 0.7345582869 0.1033366222 -0.0257350882 -0.0450369263 [16] -0.0227425767 -0.0271408114 -0.0500401715 -0.0942263180 -0.0579606605 [21] -0.0474980622 -0.0098940110 0.2229239515 -0.0765752570 0.0172887959 [26] -0.0061989824 -0.0165340889 -0.0407090429 -0.0462018027 -0.0417972597 [31] 0.0269593901 0.0274577696 0.0001541833 0.0582298025 0.0851465249 [36] -0.1132017764 -0.0140707872 0.0050591473 -0.0379938495 0.0145068130 [41] 0.0103724926 0.0343867970 -0.0254141652 0.0028245404 0.0352168824 [46] 0.0158613645 0.0297028671 -0.2269323170 > 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/3gzxn1289833272.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/499fq1289833272.tab") > > try(system("convert tmp/1280w1289833272.ps tmp/1280w1289833272.png",intern=TRUE)) character(0) > try(system("convert tmp/2280w1289833272.ps tmp/2280w1289833272.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.580 0.322 0.972