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(2194,2419,2742,2137,2710,2173,2363,2126,1905,2121,1983,1734,2074,2049,2406,2558,2251,2059,2397,1747,1707,2319,1631,1627,1791,2034,1997,2169,2028,2253,2218,1855,2187,1852,1570,1851,1954,1828,2251,2277,2085,2282,2266,1878,2267,2069,1746,2299,2360,2214,2825,2355,2333,3016,2155,2172,2150,2533,2058,2160,2260,2498,2695,2799,2945,2930,2318,2540,2570,2669,2450,2842,3440,2678,2981,2259,2844,2546,2456,2295,2379,2479,2057,2280,2351,2275,2543,2305,2188,2720,2398,2147,1898,2538,2081,2057,2497,2460,2195,2823,2100,2640,2342,2171,2482) > par5 = '12' > par4 = '0' > 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/1vcrj1242294922.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/2ni7o1242294922.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.513414683 -0.004802821 0.196057972 -0.112898906 [6] -0.078062581 0.060455757 -0.131711314 0.010836025 0.143608992 [11] -0.133584737 -0.022469984 0.259703332 -0.153537204 -0.028441465 [16] 0.195565641 -0.230116324 0.124952130 -0.091054327 -0.003636211 [21] -0.093322937 0.192481697 -0.199630231 0.113936550 0.062685259 [26] -0.004225544 -0.027069579 0.047061799 -0.061257641 0.007604939 [31] 0.008550461 -0.203014867 0.192230826 -0.047835035 -0.004673095 [36] -0.031737083 0.160880790 -0.062353280 -0.024738571 -0.004748780 [41] 0.043793283 -0.092232576 -0.002067413 0.009713686 0.042415158 [46] -0.121466002 0.132865738 -0.053949894 0.022549617 > (mypacf <- c(rpacf$acf)) [1] -0.513414683 -0.364469721 0.008721351 0.041627593 -0.106595037 [6] -0.138201408 -0.278120784 -0.280232891 -0.013304222 -0.006220933 [11] -0.174927805 0.066111223 0.089098766 -0.004315645 0.156813030 [16] -0.013055159 0.098239098 -0.055791482 0.039641641 -0.166433093 [21] 0.019238108 -0.095634747 -0.025535490 -0.068110542 0.095985957 [26] 0.040501731 -0.021645449 -0.017121246 -0.025990694 0.041975977 [31] -0.220355659 -0.047219352 -0.064473983 0.074382363 -0.083488898 [36] -0.011228501 0.054990103 -0.076628579 -0.070336023 -0.034331726 [41] -0.017933875 -0.174300510 0.083964303 0.086009207 -0.137297420 [46] -0.046672879 -0.070627444 -0.037853791 > 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/3462r1242294922.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/4cjnx1242294922.tab") > > system("convert tmp/1vcrj1242294922.ps tmp/1vcrj1242294922.png") > system("convert tmp/2ni7o1242294922.ps tmp/2ni7o1242294922.png") > > > proc.time() user system elapsed 0.599 0.349 0.971