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(41,39,50,40,43,38,44,35,39,35,29,49,50,59,63,32,47,53,60,57,52,70,90,74,62,55,84,94,70,108,139,120,97,126,149,158,124,140,109,114,77,120,133,110,92,97,78,99,107,112,90,98,125,155,190,236,189,174,178,136,161,171,149,184,155,276,224,213,279,268,287,238,213,257,293,212,246,353,339,308,247,257,322,298,273,312,249,286,279,309,401,309,328,353,354,327,324,285,243,241,287,355,460,364,487,452,391,500,451,375,372,302,316,398,394,431,431) > 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/10rwf1244052056.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/258uw1244052056.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.260507796 -0.136571864 0.155219820 -0.236711970 [6] 0.114342989 -0.059127597 -0.216179488 0.183381796 -0.093744708 [11] -0.203213637 0.106114696 0.189305088 0.050103903 0.065718910 [16] -0.080152567 -0.073422682 0.131669898 -0.165401541 0.020998392 [21] 0.113762450 -0.241542816 0.071464629 0.029638426 -0.005623307 [26] 0.178923339 -0.114133856 -0.016394409 0.095325977 -0.129298412 [31] 0.024378610 0.065419962 -0.078184123 -0.075261649 0.006913987 [36] 0.018486765 0.115254222 0.037358417 -0.156296909 0.202937313 [41] -0.035721975 -0.050160363 0.028747293 -0.059947791 0.016296996 [46] -0.092236238 -0.099895276 0.141357161 0.046631965 > (mypacf <- c(rpacf$acf)) [1] -0.2605077961 -0.2193201896 0.0616525001 -0.2270821838 0.0280826231 [6] -0.1279168481 -0.2394251672 -0.0386149127 -0.1296561371 -0.3270965900 [11] -0.2620470133 0.0926352687 0.0635818442 0.0763226604 -0.0051360957 [16] -0.1271841785 -0.0072857217 -0.0994394660 0.0219065710 0.0467103429 [21] -0.1337460869 -0.0001232901 0.0519102017 0.0737440258 0.0250316349 [26] -0.0727972877 -0.0559726112 0.0038259964 -0.0110633621 0.0070082055 [31] 0.0178838164 -0.0366587152 -0.1369811251 -0.0538209879 0.0178536323 [36] 0.0304255190 0.0075876026 -0.1319535656 0.1149803564 0.0658362747 [41] 0.1630934586 -0.0487289582 -0.0141935464 -0.0347217269 -0.0475424280 [46] 0.0413485637 0.0474067126 0.0202721693 > 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/3kqps1244052056.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/4fr001244052056.tab") > > system("convert tmp/10rwf1244052056.ps tmp/10rwf1244052056.png") > system("convert tmp/258uw1244052056.ps tmp/258uw1244052056.png") > > > proc.time() user system elapsed 0.562 0.320 0.715