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(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,2259,2498,2695,2799,2945,2930,2318,2540,2570,2669,2450,2842) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '60' > #'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/1k8od1229268636.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/2k03g1229268636.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.409201897 -0.199075839 0.390928814 -0.161996911 [6] -0.238342402 0.228363187 -0.191392084 -0.071190440 0.215943481 [11] -0.220590496 0.086866415 0.331138440 -0.335737204 0.104713927 [16] 0.242318347 -0.307903568 0.007636442 0.169131142 -0.285891411 [21] 0.036307989 0.223995455 -0.271355464 0.179148050 0.128235372 [26] -0.162221728 0.090146898 0.066268384 -0.205460762 0.112013383 [31] -0.018807661 -0.250704557 0.284872225 -0.048915303 -0.135018251 [36] 0.160279039 0.068445344 -0.099623244 0.011883374 0.088899251 [41] -0.101147632 -0.034629543 0.014087080 0.001118540 0.040920747 [46] -0.107635516 0.037460599 0.070383574 -0.016360012 -0.027069691 [51] 0.060105862 -0.001605105 -0.083817710 0.037818768 0.001003166 [56] -0.019534154 -0.004767114 0.021821248 -0.002258844 > (mypacf <- c(rpacf$acf)) [1] -0.4092018974 -0.4402382505 0.1392400791 0.0457405207 -0.2132355953 [6] -0.1318016337 -0.3109062206 -0.2292772898 -0.0517455056 -0.2532738554 [11] -0.1329703099 0.2193476954 -0.0194328321 0.0253245899 0.0763590233 [16] 0.0209323220 0.0407709415 0.0351080298 -0.0684485008 -0.0944708053 [21] 0.0981514742 -0.0205851749 0.0465649220 0.0001072658 0.1121159930 [26] 0.0180933877 -0.0433992520 -0.0496719585 0.0066196407 -0.0117283758 [31] -0.1811713806 0.0387597951 -0.0195570164 0.1151568616 -0.1448156333 [36] -0.0739072703 0.0882700307 -0.1073860580 0.0323619717 0.0400013799 [41] -0.0430165014 0.0505326048 0.1504255069 0.0594491622 -0.0195349881 [46] -0.0952807776 -0.1093697461 -0.0600256533 -0.0238931928 -0.0039394107 [51] -0.0294728865 -0.0456305138 -0.0707129722 -0.0525971572 -0.0639039062 [56] 0.0243725166 -0.0151089122 -0.0139881059 > 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/3upit1229268636.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/4opka1229268636.tab") > > system("convert tmp/1k8od1229268636.ps tmp/1k8od1229268636.png") > system("convert tmp/2k03g1229268636.ps tmp/2k03g1229268636.png") > > > proc.time() user system elapsed 2.692 0.805 2.808