R version 2.7.0 (2008-04-22) 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(98.1,101.1,111.1,93.3,100,108,70.4,75.4,105.5,112.3,102.5,93.5,86.7,95.2,103.8,97,95.5,101,67.5,64,106.7,100.6,101.2,93.1,84.2,85.8,91.8,92.4,80.3,79.7,62.5,57.1,100.8,100.7,86.2,83.2,71.7,77.5,89.8,80.3,78.7,93.8,57.6,60.6,91,85.3,77.4,77.3,68.3,69.9,81.7,75.1,69.9,84,54.3,60,89.9,77,85.3,77.6,69.2,75.5,85.7,72.2,79.9,85.3,52.2,61.2,82.4,85.4,78.2,70.2,70.2,69.3,77.5,66.1,69,79.2,56.2,63.3,77.8,92,78.1,65.1,71.1,70.9,72,81.9,70.6,72.5,65.1,54.9,80) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '-0.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/1t3zu1229679602.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/21g5p1229679602.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.559247586 -0.023857371 0.351059065 -0.404758707 [6] 0.136146388 0.068617631 -0.136397531 0.084808444 0.040799103 [11] -0.024169820 0.034591450 -0.097610594 0.006868511 -0.053651901 [16] 0.117224389 -0.127852349 0.018277527 0.218313180 -0.241188305 [21] 0.053380556 0.212177887 -0.403315727 0.380047538 -0.151443716 [26] -0.112046272 0.275407878 -0.244937006 0.111658145 0.083356533 [31] -0.221345894 0.124622975 0.090294505 -0.215207000 0.155282846 [36] -0.081742160 -0.013519029 0.034848274 0.027126199 -0.032887977 [41] 0.020779372 0.025075684 -0.006098384 -0.094541370 0.124627906 [46] -0.122813729 0.077676840 0.132360518 -0.258309095 0.260944446 [51] -0.162174692 -0.020131312 0.129407433 -0.185173384 0.103604575 [56] 0.057284995 -0.129702950 0.135079709 -0.051950849 -0.065875948 [61] 0.076805217 > (mypacf <- c(rpacf$acf)) [1] -0.559247586 -0.489805870 0.109614828 -0.153694005 -0.193178925 [6] -0.187275946 -0.071444457 -0.099201076 -0.012062854 0.092707306 [11] 0.154236110 -0.077954413 -0.179287848 -0.306843767 -0.004018960 [16] -0.174284167 -0.317743669 -0.052020810 0.014718248 -0.237974776 [21] 0.043485622 -0.129045685 0.313005938 -0.031475300 -0.014979429 [26] -0.015947660 0.014894968 -0.162441264 0.014166339 -0.134023638 [31] -0.077616577 -0.017679967 0.027026124 0.028427813 -0.045443025 [36] -0.188006169 -0.067168282 -0.076120325 -0.113567445 0.020438282 [41] -0.020405383 0.105693586 -0.102988502 -0.079463064 0.006552696 [46] -0.065058781 0.045554831 -0.065030342 -0.017783785 -0.245774524 [51] -0.050318772 0.027262024 0.026776428 0.047648903 -0.017830102 [56] 0.060658120 -0.014131489 0.067299017 0.108673848 0.023445778 > 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/3a33l1229679602.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/4lnjz1229679602.tab") > > system("convert tmp/1t3zu1229679602.ps tmp/1t3zu1229679602.png") > system("convert tmp/21g5p1229679602.ps tmp/21g5p1229679602.png") > > > proc.time() user system elapsed 1.551 0.546 1.641