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(40.22,44.23,45.85,53.38,53.26,51.8,55.3,57.81,63.96,63.77,59.15,56.12,57.42,63.52,61.71,63.01,68.18,72.03,69.75,74.41,74.33,64.24,60.03,59.44,62.5,55.04,58.34,61.92,67.65,67.68,70.3,75.26,71.44,76.36,81.71,92.6,90.6,92.23,94.09,102.79,109.65,124.05,132.69,135.81,116.07,101.42,75.73,55.48,43.8,45.29,44.01,47.48,51.07,57.84,69.04,65.61,72.87,68.41,73.25,77.43) > par7 = '0.95' > par6 = 'White Noise' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/18yuw1261917800.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/21j5c1261917800.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.542312284 0.390577769 0.060876165 -0.047610191 [6] -0.276216715 -0.303274985 -0.211469575 -0.198832538 -0.192740896 [11] -0.129307554 0.009319179 -0.094503371 -0.079397616 -0.053331595 [16] 0.008118049 -0.061583264 -0.077710200 -0.073165237 -0.014350743 [21] -0.078351833 0.040359898 0.056767108 0.162087650 0.091453723 [26] 0.171067896 0.136857219 0.044337758 -0.012907051 -0.079246551 [31] -0.040662607 -0.120709966 -0.011534287 -0.025266861 0.054087956 [36] 0.050564158 0.056053591 0.035371743 -0.021816539 -0.007020916 [41] -0.012866416 -0.027687408 -0.043550611 -0.066623168 -0.084046884 [46] -0.044077801 0.001967293 -0.011894478 0.010361929 -0.018123343 [51] 0.026034479 0.027827345 0.008433355 0.025250251 -0.016152490 [56] 0.013365100 0.003498139 0.005418981 0.003664671 > (mypacf <- c(rpacf$acf)) [1] 0.5423122843 0.1366702263 -0.2831018511 -0.0472195487 -0.2250024173 [6] -0.0832296381 0.1580587490 -0.1494628268 -0.1722803426 0.0270497275 [11] 0.0881231048 -0.2669311306 -0.0651204424 0.0579642310 -0.0584079375 [16] -0.1032234426 -0.1227886519 -0.1484243927 0.1025299947 -0.1078438412 [21] -0.0189793839 -0.0752531702 0.1189859894 -0.0747161658 0.0033719842 [26] -0.0065723009 -0.1443259397 0.0637172987 -0.0730122855 -0.0491704408 [31] -0.0003119694 0.0761639424 -0.0640157942 -0.0184401749 0.1485433957 [36] -0.1525173947 -0.0019805441 0.0479517052 -0.0020746056 0.0585703608 [41] -0.0461874102 -0.0555186700 -0.0230120892 0.0041994825 0.0744493364 [46] -0.0359681231 -0.0854499610 0.0155523778 -0.0618575806 0.0652431924 [51] -0.0107838413 -0.0301967093 -0.0224153608 -0.0106304547 0.0235472124 [56] -0.0378925750 -0.0517287594 -0.0228854979 > 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/3xorb1261917800.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/4cc8n1261917800.tab") > > try(system("convert tmp/18yuw1261917800.ps tmp/18yuw1261917800.png",intern=TRUE)) character(0) > try(system("convert tmp/21j5c1261917800.ps tmp/21j5c1261917800.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.593 0.312 0.979