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(2360,2214,2825,2355,2333,3016,2155,2172,2150,2533,2058,2160,2260,2498,2695,2799,2947,2930,2318,2540,2570,2669,2450,2842,3440,2678,2981,2260,2844,2546,2456,2295,2379,2479,2057,2280,2351,2276,2548,2311,2201,2725,2408,2139,1898,2537,2069,2063,2524,2437,2189,2793,2074,2622,2278,2144,2427,2139,1828,2072,1800,1758,2246,1987,1868,2514,2121) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '0.5' > 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/1i1441261993022.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/22gvb1261993022.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.000000000 -0.532113223 0.068166996 0.033091881 0.038490160 [6] -0.161176834 0.092520225 -0.068861234 0.125519657 -0.056448212 [11] 0.014750030 0.165110267 -0.372932467 0.185350226 -0.062123442 [16] 0.066553616 -0.171037519 0.214797770 -0.107223129 0.101996873 [21] -0.175158892 0.105640120 -0.131926720 0.175487171 -0.150082990 [26] 0.104299426 0.005473460 0.024565438 -0.024734143 -0.020732907 [31] 0.035593843 -0.109377513 0.134366848 0.016718047 -0.058310799 [36] -0.019175701 0.138271106 -0.183746293 0.106394461 -0.105592716 [41] 0.085991070 -0.026545962 -0.051092611 0.106280005 -0.037552104 [46] -0.094333765 0.115091871 -0.034074755 -0.069230953 0.091383751 [51] -0.045379512 0.012727513 0.006332054 -0.001999491 > (mypacf <- c(rpacf$acf)) [1] -0.5321132232 -0.2998895605 -0.1216043813 0.0374260579 -0.1476177923 [6] -0.1231910398 -0.1667431328 0.0445996553 0.0900317312 0.0497562795 [11] 0.2911986991 -0.2393140192 -0.2120116877 -0.2280159361 0.0205036257 [16] -0.1183875993 -0.0765202263 -0.1018246250 -0.0312654508 -0.0821516114 [21] -0.0912511513 -0.1991309451 0.1448885303 -0.1005040907 -0.0940460013 [26] -0.1025817445 0.0797375854 -0.0106139089 -0.0350114719 0.0373825691 [31] -0.0976773369 -0.0756349527 0.1280435960 -0.0783253720 0.0505232664 [36] -0.0617891812 -0.1171945448 -0.0418725922 0.0465411113 -0.0358749403 [41] -0.0371438908 -0.1766775372 -0.0165056120 -0.0292974352 0.0784290799 [46] -0.0412273164 0.0727589029 0.0056571486 0.0128384028 -0.0289654679 [51] -0.0215285578 0.0041171556 0.0003887178 > 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/3ulhu1261993022.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/4ia8s1261993022.tab") > > try(system("convert tmp/1i1441261993022.ps tmp/1i1441261993022.png",intern=TRUE)) character(0) > try(system("convert tmp/22gvb1261993022.ps tmp/22gvb1261993022.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.591 0.308 0.713