R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(40628,40167,43375,45610,46255,44375,35461,38096,40813,41582,44461,46390,45744,47990,51847,56641,55016,53119,44471,45200,46256,46922,48965,49447,51702,52837,56273,59070,57871,54862,44357,45264,47111,49050,50518,51824,53495,54623,58088,61321,60205,56527,45623,46127,48141,50648,52441,53661,54156,54245,58182,60436,59412,55903,43648,43555,45483,46956,49087,50433,50505,50890,53703,55276,53959,49732,37776,38437,40187,41626,42682,43647,43625,44352,49669,50986,48869,43127,33629,34948,36346,37607,38948,40274,40044,41139,45041,47433,48126,41639,33538,34742,37152,38399,41374,43363,44071,45080,48487,52140,52780,46700,38202,39915,42199,44356,46188,47883,48149,48201,51438,55796,55989,48794,39252,41414,43856,46086,48284,50101) > 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: Write here your technical program description (don't use hard returns!) > 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 (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/17bx31229612926.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/224vc1229612926.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.830038654 0.544379400 0.302429495 0.177186437 [6] 0.153732705 0.150483347 0.129792715 0.125013372 0.212152090 [11] 0.399252139 0.623191820 0.737463267 0.564774031 0.294159203 [16] 0.060048602 -0.060993075 -0.088505775 -0.094175522 -0.111626498 [21] -0.113977061 -0.034832702 0.127472129 0.321636321 0.413863775 [26] 0.255954436 0.014264807 -0.193145519 -0.296362612 -0.310929084 [31] -0.305697845 -0.318013374 -0.320552406 -0.250032947 -0.103074158 [36] 0.074490023 0.159820564 0.027715996 -0.172999775 -0.344335377 [41] -0.419836787 -0.415966048 -0.393117162 -0.391177064 -0.383465996 [46] -0.311379383 -0.172797979 -0.006240657 0.075219204 -0.028186384 [51] -0.182654313 -0.306306524 -0.350398360 -0.331972679 -0.297703933 [56] -0.288589708 -0.273220259 -0.205027918 -0.083453069 0.061176538 [61] 0.129856223 > (mypacf <- c(rpacf$acf)) [1] 0.8300386540 -0.4648492293 0.1081571383 0.1208924788 0.0604710603 [6] -0.0819216196 0.0107253651 0.1475437357 0.3252656096 0.2995437864 [11] 0.3202731798 0.0136954524 -0.7052001197 0.1966477113 -0.1581824324 [16] -0.0582565973 -0.1191007887 -0.0001921032 0.0007794687 -0.0274900819 [21] -0.0210015711 -0.0224383347 0.0274165933 -0.0095568995 -0.1033595358 [26] 0.0374928275 -0.0018353787 -0.0761736092 0.0434662234 -0.0791096488 [31] -0.0935157800 -0.0499713612 -0.0338567571 0.0078574021 -0.0512335370 [36] 0.0140898677 -0.0173686808 0.0571925645 -0.0507430737 0.0105154862 [41] -0.0329032164 0.0466271044 -0.0510843907 0.0160979518 -0.0192601387 [46] -0.0269564766 -0.0045105322 -0.0392933726 0.0484082410 0.0349388910 [51] 0.0711252815 -0.0808049318 0.0173471490 0.0278249492 -0.0274086649 [56] 0.0337554937 -0.0710936395 -0.0222818752 -0.0311519633 0.0119013247 > 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/3xtjj1229612926.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/4a60e1229612926.tab") > > system("convert tmp/17bx31229612926.ps tmp/17bx31229612926.png") > system("convert tmp/224vc1229612926.ps tmp/224vc1229612926.png") > > > proc.time() user system elapsed 0.633 0.365 0.827