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(14.3,14.2,15.9,15.3,15.5,15.1,15,12.1,15.8,16.9,15.1,13.7,14.8,14.7,16,15.4,15,15.5,15.1,11.7,16.3,16.7,15,14.9,14.6,15.3,17.9,16.4,15.4,17.9,15.9,13.9,17.8,17.9,17.4,16.7,16,16.6,19.1,17.8,17.2,18.6,16.3,15.1,19.2,17.7,19.1,18,17.5,17.8,21.1,17.2,19.4,19.8,17.6,16.2,19.5,19.9,20,17.3,18.9,18.6,21.4,18.6,19.8,20.8,19.6,17.7,19.8,22.2,20.7,17.9) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > 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: > 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/1sk661262006354.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/2ft7l1262006354.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.3329267039 -0.3014407855 0.0723027202 0.1292692766 [6] -0.2056461600 0.3231146421 -0.2605078420 0.1629976234 0.0872643315 [11] -0.3442267284 -0.1650939780 0.7044405959 -0.2669941607 -0.1509418027 [16] 0.0056619205 0.0195641271 -0.0493815096 0.2172339361 -0.2138367278 [21] 0.1528605874 0.0710821004 -0.3540533011 0.0272948976 0.4234271143 [26] -0.1913140651 -0.0589773006 -0.0387570007 -0.0006541266 0.0027713255 [31] 0.1180431060 -0.1498956795 0.1928467976 -0.0407741950 -0.2368114536 [36] 0.0236726186 0.2992340469 -0.1057262135 -0.0485839857 -0.0935460581 [41] 0.0898757258 -0.0308620352 0.0661714089 -0.1285538385 0.1997543059 [46] -0.0765454433 -0.1237288197 -0.0387846608 0.2206580888 -0.0379435965 [51] -0.0612472647 -0.0782698520 0.0838835403 -0.0240744033 0.0406642311 [56] -0.0603259664 0.0872848179 -0.0309023934 -0.0513433913 -0.0394376514 [61] 0.1140559147 > (mypacf <- c(rpacf$acf)) [1] -0.3329267039 -0.4636747760 -0.3280221765 -0.1953183531 -0.4379258335 [6] 0.0860189108 -0.3395585808 0.2378052700 0.3481542174 -0.1897879412 [11] -0.4096235595 0.1258991883 -0.0031935528 0.1791328614 0.0001649882 [16] -0.0671888883 0.0056474463 -0.1410844607 0.0971497372 -0.0616061721 [21] 0.0447038707 -0.1036799618 0.0992256787 0.0436250440 -0.0104241911 [26] 0.0489093825 -0.1513141480 0.1465009473 -0.1335972941 -0.0198994284 [31] -0.0805335686 -0.0123601951 0.0183968459 0.1135422697 -0.1023906755 [36] 0.0448986934 0.0207879575 -0.0566518204 -0.0072379525 -0.0246462851 [41] 0.0406058173 0.0145840008 -0.0423433516 -0.1250564021 -0.0106869499 [46] -0.0597542874 0.0640216267 -0.0319302104 -0.0518674762 -0.0497577523 [51] -0.0224878617 -0.0643690316 -0.0576580742 -0.0418333033 0.0451858235 [56] -0.0137508380 -0.0582475825 0.0072923192 0.0648469193 -0.0071561752 > 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/3m7tk1262006354.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/47jjk1262006354.tab") > > try(system("convert tmp/1sk661262006354.ps tmp/1sk661262006354.png",intern=TRUE)) character(0) > try(system("convert tmp/2ft7l1262006354.ps tmp/2ft7l1262006354.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.582 0.309 1.004