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(98.6,98,106.8,96.6,100.1,107.7,91.5,97.8,107.4,117.5,105.6,97.4,99.5,98,104.3,100.6,101.1,103.9,96.9,95.5,108.4,117,103.8,100.8,110.6,104,112.6,107.3,98.9,109.8,104.9,102.2,123.9,124.9,112.7,121.9,100.6,104.3,120.4,107.5,102.9,125.6,107.5,108.8,128.4,121.1,119.5,128.7,108.7,105.5,119.8,111.3,110.6,120.1,97.5,107.7,127.3,117.2,119.8,116.2) > par5 = '12' > par4 = '1' > 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/freestat/rcomp/tmp/1wai21229992709.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/freestat/rcomp/tmp/2cqkp1229992709.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.1734159084 0.1136458325 0.3376380791 -0.0371475553 [6] 0.1278996042 0.2584599057 -0.1123131092 0.1964518000 0.2231513916 [11] -0.1506039221 0.0228306530 -0.1612703531 -0.2442347424 0.1089321934 [16] -0.0940226394 -0.1340394437 0.2035738203 -0.2090450246 -0.1730798462 [21] -0.0383128536 -0.2245256001 -0.1271106541 0.0284837298 -0.2955135581 [26] -0.1279552525 -0.0799413699 -0.2226353709 -0.0674156775 -0.1299897275 [31] -0.1313113141 -0.0005164791 -0.0318664924 -0.0414241793 -0.0056866518 [36] -0.0416355663 0.0407052034 0.1085964549 0.0496457343 0.0360238074 [41] 0.1016870424 0.0298606497 0.0782621540 0.0402686576 0.0114386545 [46] 0.0512974650 0.0243636483 0.0149649937 > (mypacf <- c(rpacf$acf)) [1] 0.1734159084 0.0861639710 0.3164825835 -0.1620950073 0.1307306811 [6] 0.1430354544 -0.1555523638 0.1807688491 0.0896757434 -0.1581512893 [11] -0.1170726627 -0.2519466592 -0.0588401298 0.1041069820 -0.0112409410 [16] 0.0126486186 0.1736646480 -0.1899114274 -0.0876491383 -0.0982096571 [21] 0.0964393988 -0.1288111075 -0.0306053842 -0.2200895270 -0.1549837961 [26] -0.0818099239 0.1152187566 0.0624628009 0.0167729158 0.0279971159 [31] -0.1669853734 0.0375476929 0.1095591950 -0.0772480060 0.0541707604 [36] -0.0720005846 -0.0200411059 -0.0505303383 0.0169160539 0.0660311728 [41] 0.0605258364 -0.0044911101 -0.1101213531 -0.1385773036 -0.0012971511 [46] -0.0734916390 -0.0001094210 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3x6ig1229992709.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/freestat/rcomp/tmp/42b9l1229992709.tab") > > system("convert tmp/1wai21229992709.ps tmp/1wai21229992709.png") > system("convert tmp/2cqkp1229992709.ps tmp/2cqkp1229992709.png") > > > proc.time() user system elapsed 0.863 0.456 2.890