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(103.3,101.2,107.7,110.4,101.9,115.9,89.9,88.6,117.2,123.9,100,103.6,94.1,98.7,119.5,112.7,104.4,124.7,89.1,97,121.6,118.8,114,111.5,97.2,102.5,113.4,109.8,104.9,126.1,80,96.8,117.2,112.3,117.3,111.1,102.2,104.3,122.9,107.6,121.3,131.5,89,104.4,128.9,135.9,133.3,121.3,120.5,120.4,137.9,126.1,133.2,151.1,105,119,140.4,156.6,137.1,122.7) > par5 = '12' > par4 = '0' > par3 = '0' > 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/1tc571229094636.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/213kz1229094636.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.388842990 0.122874110 0.256717442 0.197897504 [6] 0.361758502 0.536016319 0.281128285 0.107880283 0.138212224 [11] -0.065876056 0.153838943 0.543840248 0.065363726 -0.100694889 [16] -0.046429804 -0.112852821 0.059383116 0.191238398 0.009989417 [21] -0.084555856 -0.078477040 -0.239374326 -0.015091414 0.245710570 [26] -0.077235066 -0.136981632 -0.146270106 -0.169799805 -0.026999265 [31] 0.068916528 -0.045562702 -0.089863414 -0.139160046 -0.245496565 [36] -0.057255511 0.108014345 -0.092694421 -0.165280018 -0.181761590 [41] -0.192920207 -0.104682577 -0.048465245 -0.117240289 -0.143577861 [46] -0.194501435 -0.235567154 -0.123265853 -0.021447290 > (mypacf <- c(rpacf$acf)) [1] 0.3888429902 -0.0333703152 0.2598556207 0.0106307116 0.3548812568 [6] 0.3405047187 0.0176527680 -0.0595951889 -0.0781951235 -0.4122772025 [11] 0.0222037833 0.4055984940 -0.3284088858 -0.0009732161 -0.1375481775 [16] -0.0168514353 -0.0377000939 -0.0437664704 0.1490390907 0.0536059863 [21] 0.0013718030 0.0543449842 -0.0274031402 -0.0450567641 -0.0402851747 [26] -0.0051395292 -0.0676736384 0.0359382519 -0.0881919303 0.0157720814 [31] -0.0239462051 0.0007999442 -0.0658159760 0.0237098069 -0.0571874317 [36] 0.0318847470 -0.0162747761 -0.1264998416 0.0673297389 -0.1009180266 [41] -0.0425197553 -0.0552429506 -0.0688440719 0.0123855601 0.0017612441 [46] 0.0816264082 -0.0216468848 -0.0241521925 > 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/3lmgw1229094636.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/43dxx1229094636.tab") > > system("convert tmp/1tc571229094636.ps tmp/1tc571229094636.png") > system("convert tmp/213kz1229094636.ps tmp/213kz1229094636.png") > > > proc.time() user system elapsed 1.524 0.539 1.628