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(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 = '0' > par2 = '1' > 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/1fxdc1228499870.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/2r5dp1228499870.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.5516313332 0.4673981271 0.5253721217 0.3078942042 [6] 0.2597559551 0.3068373868 0.1375478582 0.1294997105 0.1182286688 [11] -0.0660141073 -0.0361629362 -0.0635377311 -0.0677250423 -0.0300510831 [16] 0.0008952354 -0.1274959230 0.0435622585 0.0117460426 -0.0694844472 [21] 0.1317628970 0.0830598280 0.0405777195 0.1435641925 0.0438774953 [26] -0.0729731998 0.0060220402 -0.1248957898 -0.1464424060 -0.1267719399 [31] -0.2006297766 -0.2082136278 -0.1959846493 -0.2471714006 -0.2846957906 [36] -0.2050569159 -0.2700833555 > (mypacf <- c(rpacf$acf)) [1] 0.551631333 0.234440601 0.302163515 -0.156291250 -0.014737962 [6] 0.092819124 -0.110167796 0.010612850 -0.046909663 -0.177815026 [11] 0.013307437 -0.054243444 0.147523350 0.018757560 0.076955852 [16] -0.199414942 0.232365613 -0.048028802 -0.030793287 0.169257209 [21] -0.073414111 0.030741560 -0.036081307 -0.087275833 -0.122394844 [26] -0.103061303 -0.054796259 -0.054956461 -0.009378243 -0.038207352 [31] 0.035428047 -0.033716341 0.038240696 -0.126603412 0.012842633 [36] -0.024259607 > 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/3q3c61228499870.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/4w2mr1228499870.tab") > > system("convert tmp/1fxdc1228499870.ps tmp/1fxdc1228499870.png") > system("convert tmp/2r5dp1228499870.ps tmp/2r5dp1228499870.png") > > > proc.time() user system elapsed 0.537 0.323 0.692