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(93.0,99.2,112.2,112.1,103.3,108.2,90.4,72.8,111.0,117.9,111.3,110.5,94.8,100.4,132.1,114.6,101.9,130.2,84.0,86.4,122.3,120.9,110.2,112.6,102.0,105.0,130.5,115.5,103.7,130.9,89.1,93.8,123.8,111.9,118.3,116.9,103.6,116.6,141.3,107.0,125.2,136.4,91.6,95.3,132.3,130.6,131.9,118.6,114.3,111.3,126.5,112.1,119.3,142.4,101.1,97.4,129.1,136.9,129.8,123.9) > par5 = '12' > par4 = '0' > par3 = '0' > 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/1pu551229685552.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/2amvy1229685552.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.127704875 -0.211408423 0.236878260 -0.052329326 [6] 0.078792613 0.491399465 0.079066117 -0.034314631 0.158316348 [11] -0.263039443 0.070609212 0.662938052 0.003958595 -0.202932725 [16] 0.139606661 -0.148858023 -0.008854511 0.315926705 0.020472630 [21] -0.040640901 0.073701801 -0.281349203 0.017978334 0.375503012 [26] -0.097797940 -0.149382117 0.019132810 -0.197688770 -0.057052200 [31] 0.150560641 -0.026021675 -0.045952254 -0.070555873 -0.272516352 [36] -0.044957330 0.186516713 -0.098974508 -0.172255454 -0.074137324 [41] -0.192716390 -0.112208153 0.071905120 -0.001477865 -0.069631399 [46] -0.105340874 -0.173210342 -0.044053807 0.038606924 -0.048361588 [51] -0.095501609 -0.085095399 -0.112208876 -0.075275205 0.010123480 [56] -0.008190631 -0.051950079 -0.054156535 -0.034580112 -0.014720520 > (mypacf <- c(rpacf$acf)) [1] 0.1277048748 -0.2314922581 0.3219077570 -0.2492327052 0.3714200655 [6] 0.2788403487 0.0871531334 0.1232413841 -0.0263110584 -0.3653300812 [11] 0.2333180340 0.3725482933 -0.1197705733 -0.0836911153 -0.0847756588 [16] -0.0363158064 -0.0453103173 -0.1445577519 0.0988670430 -0.0307577743 [21] 0.0937543275 -0.0584760224 0.0511376077 -0.1853673083 0.0163341399 [26] -0.0609294617 -0.0963997546 0.0126272782 -0.0282860807 -0.0083434970 [31] 0.0657479573 -0.0733729625 -0.0686651994 -0.0251522044 -0.0997132431 [36] 0.0809405570 -0.0129229975 -0.1583689331 0.0682818999 -0.0986420259 [41] -0.0005267789 0.0277056753 0.0069376240 0.0017399655 0.0876038536 [46] 0.0748859421 0.0031231932 -0.2040098114 0.0118965260 0.0238319213 [51] -0.0253561279 -0.0044444697 0.0743945195 -0.0810993919 -0.0862862551 [56] 0.0488609062 0.0408055053 0.0441978652 0.0731930450 > 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/3ms381229685552.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/4q8qd1229685552.tab") > > system("convert tmp/1pu551229685552.ps tmp/1pu551229685552.png") > system("convert tmp/2amvy1229685552.ps tmp/2amvy1229685552.png") > > > proc.time() user system elapsed 0.593 0.323 0.710