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(785.8,819.3,849.4,880.4,900.1,937.2,948.9,952.6,947.3,974.2,1000.8,1032.8,1050.7,1057.3,1075.4,1118.4,1179.8,1227,1257.8,1251.5,1236.3,1170.6,1213.1,1265.5,1300.8,1348.4,1371.9,1403.3,1451.8,1474.2,1438.2,1513.6,1562.2,1546.2,1527.5,1418.7,1448.5,1492.1,1395.4,1403.7,1316.6,1274.5,1264.4,1323.9,1332.1,1250.2,1096.7,1080.8,1039.2,792,746.6,688.8,715.8,672.9,629.5,681.2,755.4,760.6,765.9,836.8,904.9) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/1m1ce1259230050.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/2fng01259230050.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.00000000 0.95891626 0.90197683 0.83742206 0.76419008 0.68072108 [7] 0.58547884 0.48970187 0.39700260 0.29872246 0.19953647 0.11231863 [13] 0.02538945 -0.04875606 -0.12059365 -0.19287535 -0.25396419 -0.30914107 [19] -0.35548931 -0.39331852 -0.43113652 -0.46449302 -0.49260008 -0.50968675 [25] -0.51227176 -0.50900126 -0.50022075 -0.48002129 -0.45610390 -0.43152734 [31] -0.40571345 -0.38385181 -0.35085281 -0.31300477 -0.27549611 -0.23687292 [37] -0.20282062 -0.16559041 -0.12362410 -0.08863955 -0.05145050 -0.01563088 [43] 0.01798035 0.05121709 0.08842064 0.12640479 0.15672654 0.17479654 [49] 0.19244693 0.20877359 0.20532823 0.19612255 0.18038534 0.16528304 [55] 0.14629715 0.12205811 0.09964241 0.08018205 0.05913795 0.03596493 [61] 0.01620391 > (mypacf <- c(rpacf$acf)) [1] 0.958916262 -0.217987813 -0.091424848 -0.121162397 -0.140466540 [6] -0.163896603 -0.015351192 -0.005437506 -0.136437914 -0.057765595 [11] 0.091158369 -0.132050321 0.089273831 -0.092430265 -0.130504145 [16] 0.020567982 -0.046841346 -0.008137041 -0.017476013 -0.115969837 [21] -0.068641304 -0.076982503 0.098104127 0.040612126 -0.036443204 [26] -0.006570614 0.001506290 -0.045135253 -0.069941383 -0.058152510 [31] -0.126776725 0.066182123 0.044241122 -0.011563767 -0.003554305 [36] -0.084133918 -0.002976241 0.036535935 -0.072639282 0.057599913 [41] -0.073626963 0.009310260 -0.026413363 0.129659867 0.035721452 [46] -0.175270162 -0.093699451 0.050340752 0.004271724 -0.166137933 [51] -0.043119761 -0.088012542 -0.018088778 0.018724865 0.048473799 [56] -0.002569708 -0.037100178 -0.046180507 -0.037466544 0.047455415 > 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/33uzv1259230050.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/4vdnk1259230050.tab") > > system("convert tmp/1m1ce1259230050.ps tmp/1m1ce1259230050.png") > system("convert tmp/2fng01259230050.ps tmp/2fng01259230050.png") > > > proc.time() user system elapsed 0.589 0.333 1.272