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(2150.3,2425.7,2642.0,2291.5,2570.7,2526.6,2266.2,1981.9,2630.3,2942.6,2713.4,2437.5,2678.9,2582.0,2780.0,2512.4,2658.4,2708.7,2518.7,2018.3,2579.3,2693.5,2468.8,2122.8,2412.8,2370.6,2642.5,2634.2,2457.5,2579.1,2505.9,1903.2,2660.2,2844.1,2607.1,2356.0,2659.9,2531.4,2845.7,2654.3,2588.2,2789.6,2533.1,1846.5,2796.3,2895.6,2472.2,2584.4,2630.4,2663.1,3176.2,2856.7,2551.4,3088.7,2628.3,2226.2,3023.6,3077.9,3084.1,2990.3,2949.6,3014.7,3517.7,3121.2,3067.4,3174.6,2676.3,2424.0,3195.1,3146.6,3506.7,3528.5) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '-0.3' > par1 = '36' > #'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/1j3zd1229454999.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/2jtfk1229454999.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.387789142 -0.121456366 0.326385783 -0.208544068 [6] -0.079205881 0.243031910 -0.252156733 0.104947031 0.231641311 [11] -0.254062279 0.079690701 -0.050257353 -0.145383917 0.077972571 [16] 0.143084095 -0.322204130 0.283920595 -0.002412788 -0.253994749 [21] 0.249030865 -0.099953921 -0.127234838 0.295044115 -0.094123599 [26] -0.103849977 0.205066318 -0.160006098 -0.004876095 0.123160381 [31] -0.112162655 0.009669206 0.064161042 -0.051689591 -0.084133324 [36] 0.077138144 -0.118042691 > (mypacf <- c(rpacf$acf)) [1] -0.387789142 -0.319951177 0.183759401 -0.022859452 -0.115688293 [6] 0.084566008 -0.126198313 0.054065235 0.224259573 0.027737875 [11] -0.002617049 -0.248830369 -0.176753115 -0.111907519 0.213549575 [16] -0.148861623 0.042295962 -0.024005324 -0.126508573 0.132716639 [21] 0.033083795 0.058555628 0.074944978 0.014690499 0.021844877 [26] -0.067469766 0.019096035 -0.042834897 0.030826579 0.011928485 [31] -0.032602748 -0.164934749 0.023471933 -0.087066337 -0.014401888 [36] 0.010021604 > 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/3sysd1229454999.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/4zqfd1229454999.tab") > > system("convert tmp/1j3zd1229454999.ps tmp/1j3zd1229454999.png") > system("convert tmp/2jtfk1229454999.ps tmp/2jtfk1229454999.png") > > > proc.time() user system elapsed 2.392 0.908 2.517