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(5.7,5.7,5.6,5.8,5.6,5.6,5.6,5.5,5.4,5.4,5.5,5.4,5.4,5.2,5.4,5.2,5.1,5.1,5.0,5.0,4.9,5.1,5.0,5.0,4.8,4.7,4.7,4.7,4.7,4.7,4.6,4.7,4.7,4.5,4.4,4.5,4.4,4.6,4.5,4.4,4.5,4.5,4.6,4.7,4.7,4.7,4.8,4.7,5.0,4.9,4.8,5.1,5.0,5.5,5.5,5.7,6.1,6.1,6.5,6.7) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '-2.0' > 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/1o5o01228853152.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/2b5wo1228853152.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.2502685190 0.2401592544 0.1991298779 -0.1278928193 [6] 0.3930591794 0.0199900337 0.0541808813 0.1245394979 0.0850935303 [11] -0.0324040263 0.3209538581 -0.1229253988 0.0301065582 0.1484761826 [16] -0.1581437401 0.2580334569 -0.0806126943 0.0123072391 -0.0529914210 [21] -0.0832538718 0.0586217644 -0.0628639462 -0.0155108009 -0.1416497625 [26] 0.0202975535 -0.0698631942 -0.0034769037 -0.0620459620 -0.1202455158 [31] -0.0130272967 -0.1382630703 0.0931161571 -0.2270768558 0.0945901976 [36] -0.1362508871 -0.1000826228 0.0442097273 -0.1526553436 0.0511074844 [41] -0.1594365347 -0.0231684308 -0.0425512112 -0.0344854783 -0.0706366322 [46] 0.0028389773 -0.0479511256 -0.0725744747 0.0294950360 -0.0955065753 [51] 0.0343426267 -0.0651434507 -0.0238133978 0.0153051191 -0.0413823150 [56] 0.0096888008 -0.0042837667 -0.0066119449 -0.0005930044 > (mypacf <- c(rpacf$acf)) [1] -0.2502685190 0.1893870544 0.3266949226 -0.0678979712 0.2694683517 [6] 0.2061691436 -0.0099453553 -0.0801111254 0.1519483048 -0.1354419906 [11] 0.2008024655 -0.0209275140 -0.1563207187 -0.0270531640 -0.0006380770 [16] 0.0165103850 -0.0116528880 0.0330678265 -0.2228561818 -0.1567793072 [21] 0.0683385635 -0.0655120955 -0.0450816351 -0.0231400148 -0.0064809587 [26] 0.0100880755 0.0369278467 -0.0234988779 -0.0611990393 0.0534099914 [31] -0.0632611353 0.0511467572 -0.1208630353 0.1241183326 0.0154227845 [36] -0.0531183087 -0.0746607432 0.0475584312 -0.0251643269 -0.0811439845 [41] -0.0117449384 0.0097724744 -0.0916827739 0.0068153810 0.0775803467 [46] -0.0085366298 -0.0008425984 -0.0647345056 -0.0042801294 -0.0141386958 [51] 0.0181939694 -0.0454162336 0.0160018267 0.0628506822 -0.0504854769 [56] 0.0035574579 0.0435842521 0.0291829160 > 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/3alz61228853152.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/431vt1228853153.tab") > > system("convert tmp/1o5o01228853152.ps tmp/1o5o01228853152.png") > system("convert tmp/2b5wo1228853152.ps tmp/2b5wo1228853152.png") > > > proc.time() user system elapsed 0.596 0.337 0.702