R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(595,591,589,584,573,567,569,621,629,628,612,595,597,593,590,580,574,573,573,620,626,620,588,566,557,561,549,532,526,511,499,555,565,542,527,510,514,517,508,493,490,469,478,528,534,518,506,502,516,528,533,536,537,524,536,587,597,581,564,564) > par7 = '' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1' > par1 = '48' > #'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/1wgji1259797569.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/2wg6k1259797569.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.1300740494 0.2391788424 0.3366130460 0.2219400801 [6] 0.0651883591 0.1903234444 0.0204377373 0.1533898004 0.0229853191 [11] -0.0816694763 0.2890174925 -0.1488527514 -0.0748633839 0.1007284032 [16] 0.0670178646 -0.1091543513 0.0899737341 -0.1656975123 -0.0266479625 [21] -0.1460647730 -0.2058969442 -0.0904324727 -0.1820020617 -0.1950238282 [26] -0.0739496690 -0.1284282470 -0.2372659181 -0.1010516997 -0.1379634187 [31] -0.1007479930 -0.0463437524 -0.0714873223 -0.0513204691 0.0079190783 [36] -0.0163891359 -0.0063319155 -0.0170854170 -0.0177109931 0.0040594990 [41] -0.0005477359 -0.0159658146 -0.0031708228 0.0140326519 -0.0003366591 [46] 0.0005194540 -0.0009963553 > (mypacf <- c(rpacf$acf)) [1] 0.130074049 0.226084771 0.303514749 0.147487254 -0.095051679 [6] 0.022420808 -0.108369053 0.113981675 -0.026811852 -0.161511067 [11] 0.315280279 -0.244519198 -0.068649267 0.051994989 0.118676826 [16] 0.009348776 -0.059509367 -0.186181314 -0.095941112 -0.083308259 [21] -0.065486746 -0.080746273 0.008009632 0.052162233 -0.042327572 [26] -0.055911526 -0.072692648 -0.095801914 0.108961018 -0.042137066 [31] 0.097015321 0.010859735 -0.039350960 0.047119944 0.045931838 [36] 0.018635458 -0.036035107 0.013824542 -0.048225789 -0.092102140 [41] -0.013007278 -0.050919542 0.064233122 0.037663789 -0.082974570 [46] -0.123238307 > 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 1:par1) { + 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(mytstat,lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/3n4p61259797569.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-1,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(mytstat,lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/45vl31259797569.tab") > system("convert tmp/1wgji1259797569.ps tmp/1wgji1259797569.png") > system("convert tmp/2wg6k1259797569.ps tmp/2wg6k1259797569.png") > > > proc.time() user system elapsed 0.591 0.319 1.329