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(2550,2867,3458,2961,3163,2880,3331,3062,3534,3622,4464,5411,2564,2820,3508,3088,3299,2939,3320,3418,3604,3495,4163,4882,2211,3260,2992,2425,2707,3244,3965,3315,3333,3583,4021,4904,2252,2952,3573,3048,3059,2731,3563,3092,3478,3478,4308,5029,2075,3264,3308,3688,3136,2824,3644,4694,2914,3686,4358,5587,2265,3685,3754,3708,3210,3517,3905,3670,4221,4404,5086,5725,2367,3819,4067,4022,3937,4365,4290) > 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/freestat/rcomp/tmp/16izo1272902294.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/freestat/rcomp/tmp/26izo1272902294.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.416966566 -0.142710054 0.019690297 0.131171990 [6] 0.020669120 -0.239702984 0.056312519 0.101615969 0.052881752 [11] -0.142052661 -0.268244859 0.688427605 -0.314945668 -0.099114097 [16] 0.029251689 0.109756547 0.014714921 -0.242157420 0.116532748 [21] 0.042619204 0.042098147 -0.107731781 -0.218484309 0.553082802 [26] -0.246205602 -0.076067958 0.020848561 0.028665638 0.084726475 [31] -0.164743454 0.029325033 0.026871217 0.083613973 -0.140293303 [36] -0.129423445 0.424908563 -0.211500032 -0.045817211 0.008735275 [41] 0.041798171 0.058097699 -0.138779999 0.015597560 0.033890946 [46] 0.061482572 -0.099000381 -0.083357466 0.277797815 -0.123153400 [51] -0.056737883 0.039392781 0.001090570 0.009581237 -0.059991257 [56] 0.057864116 -0.045948170 0.064413226 -0.078856221 -0.011486409 [61] 0.146330404 > (mypacf <- c(rpacf$acf)) [1] -0.416966566 -0.383193647 -0.315531072 -0.106061863 0.046320503 [6] -0.205935196 -0.237319057 -0.191827838 -0.043597520 -0.089585946 [11] -0.613915922 0.205906322 0.024296228 0.024218834 0.096090795 [16] 0.045030122 0.078868791 -0.013460027 0.082688994 0.020540713 [21] -0.046680934 -0.004090396 -0.191000282 -0.039831928 -0.003315385 [26] 0.006232004 0.039417493 -0.206916683 -0.050295039 0.172815587 [31] -0.025996868 0.016798262 0.056083977 -0.132084658 0.008690189 [36] 0.035229383 -0.009801083 -0.052248611 -0.106308958 0.052732971 [41] -0.061398496 -0.042488800 -0.009441855 -0.054388732 -0.108727024 [46] -0.023675739 0.136115911 -0.069076361 -0.045033012 0.005829562 [51] 0.037131928 0.004663365 -0.091445830 -0.086988950 0.054808455 [56] -0.087565961 0.033999209 0.014214242 -0.033888722 -0.037134194 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3cjir1272902295.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/freestat/rcomp/tmp/45tzu1272902295.tab") > > try(system("convert tmp/16izo1272902294.ps tmp/16izo1272902294.png",intern=TRUE)) character(0) > try(system("convert tmp/26izo1272902294.ps tmp/26izo1272902294.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.816 0.427 0.956