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 <- array(list(3.1,6.3,3.5,7.1,6,7.5,5.7,7.4,4.7,7.1,4.2,6.8,3.6,6.9,4.4,7.2,2.5,7.4,-0.6,7.3,-1.9,6.9,-1.9,6.9,0.7,6.8,-0.9,7.1,-1.7,7.2,-3.1,7.1,-2.1,7,0.2,6.9,1.2,7.1,3.8,7.3,4,7.5,6.6,7.5,5.3,7.5,7.6,7.3,4.7,7,6.6,6.7,4.4,6.5,4.6,6.5,6,6.5,4.8,6.6,4,6.8,2.7,6.9,3,6.9,4.1,6.8,4,6.8,2.7,6.5,2.6,6.1,3.1,6.1,4.4,5.9,3,5.7,2,5.9,1.3,5.9,1.5,6.1,1.3,6.3,3.2,6.2,1.8,5.9,3.3,5.7,1,5.4,2.4,5.6,0.4,6.2,-0.1,6.3,1.3,6,-1.1,5.6,-4.4,5.5,-7.5,5.9,-12.2,6.5,-14.5,6.8,-16,6.8,-16.7,6.5,-16.3,6.2,-16.9,6.2),dim=c(2,61),dimnames=list(c('ip','wklh'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('ip','wklh'),1:61)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > #'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!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x ip wklh 1 3.1 6.3 2 3.5 7.1 3 6.0 7.5 4 5.7 7.4 5 4.7 7.1 6 4.2 6.8 7 3.6 6.9 8 4.4 7.2 9 2.5 7.4 10 -0.6 7.3 11 -1.9 6.9 12 -1.9 6.9 13 0.7 6.8 14 -0.9 7.1 15 -1.7 7.2 16 -3.1 7.1 17 -2.1 7.0 18 0.2 6.9 19 1.2 7.1 20 3.8 7.3 21 4.0 7.5 22 6.6 7.5 23 5.3 7.5 24 7.6 7.3 25 4.7 7.0 26 6.6 6.7 27 4.4 6.5 28 4.6 6.5 29 6.0 6.5 30 4.8 6.6 31 4.0 6.8 32 2.7 6.9 33 3.0 6.9 34 4.1 6.8 35 4.0 6.8 36 2.7 6.5 37 2.6 6.1 38 3.1 6.1 39 4.4 5.9 40 3.0 5.7 41 2.0 5.9 42 1.3 5.9 43 1.5 6.1 44 1.3 6.3 45 3.2 6.2 46 1.8 5.9 47 3.3 5.7 48 1.0 5.4 49 2.4 5.6 50 0.4 6.2 51 -0.1 6.3 52 1.3 6.0 53 -1.1 5.6 54 -4.4 5.5 55 -7.5 5.9 56 -12.2 6.5 57 -14.5 6.8 58 -16.0 6.8 59 -16.7 6.5 60 -16.3 6.2 61 -16.9 6.2 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) wklh -13.140 2.072 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -17.030 -0.959 2.213 3.334 5.855 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -13.140 8.862 -1.483 0.143 wklh 2.072 1.337 1.550 0.126 Residual standard error: 5.965 on 59 degrees of freedom Multiple R-squared: 0.03914, Adjusted R-squared: 0.02285 F-statistic: 2.403 on 1 and 59 DF, p-value: 0.1264 > if (n > n25) { + kp3 <- k + 3 + nmkm3 <- n - k - 3 + gqarr <- array(NA, dim=c(nmkm3-kp3+1,3)) + numgqtests <- 0 + numsignificant1 <- 0 + numsignificant5 <- 0 + numsignificant10 <- 0 + for (mypoint in kp3:nmkm3) { + j <- 0 + numgqtests <- numgqtests + 1 + for (myalt in c('greater', 'two.sided', 'less')) { + j <- j + 1 + gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value + } + if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1 + } + gqarr + } [,1] [,2] [,3] [1,] 2.580044e-03 5.160088e-03 0.99741996 [2,] 2.737347e-04 5.474695e-04 0.99972627 [3,] 3.823269e-05 7.646539e-05 0.99996177 [4,] 4.364790e-06 8.729580e-06 0.99999564 [5,] 3.179133e-05 6.358266e-05 0.99996821 [6,] 7.608296e-04 1.521659e-03 0.99923917 [7,] 2.554371e-03 5.108743e-03 0.99744563 [8,] 3.394972e-03 6.789945e-03 0.99660503 [9,] 1.480444e-03 2.960888e-03 0.99851956 [10,] 1.138380e-03 2.276761e-03 0.99886162 [11,] 1.134390e-03 2.268781e-03 0.99886561 [12,] 1.543160e-03 3.086320e-03 0.99845684 [13,] 1.164968e-03 2.329936e-03 0.99883503 [14,] 5.209201e-04 1.041840e-03 0.99947908 [15,] 2.158794e-04 4.317588e-04 0.99978412 [16,] 1.006843e-04 2.013687e-04 0.99989932 [17,] 4.301488e-05 8.602975e-05 0.99995699 [18,] 3.341512e-05 6.683025e-05 0.99996658 [19,] 1.640988e-05 3.281976e-05 0.99998359 [20,] 2.336389e-05 4.672779e-05 0.99997664 [21,] 1.557875e-05 3.115751e-05 0.99998442 [22,] 3.109818e-05 6.219635e-05 0.99996890 [23,] 2.326931e-05 4.653862e-05 0.99997673 [24,] 1.658069e-05 3.316139e-05 0.99998342 [25,] 1.730107e-05 3.460215e-05 0.99998270 [26,] 1.217048e-05 2.434096e-05 0.99998783 [27,] 8.029844e-06 1.605969e-05 0.99999197 [28,] 5.150733e-06 1.030147e-05 0.99999485 [29,] 4.265548e-06 8.531095e-06 0.99999573 [30,] 6.029820e-06 1.205964e-05 0.99999397 [31,] 1.685899e-05 3.371798e-05 0.99998314 [32,] 2.718410e-05 5.436819e-05 0.99997282 [33,] 1.932304e-05 3.864607e-05 0.99998068 [34,] 1.627842e-05 3.255685e-05 0.99998372 [35,] 1.294982e-05 2.589965e-05 0.99998705 [36,] 5.918495e-06 1.183699e-05 0.99999408 [37,] 3.271485e-06 6.542969e-06 0.99999673 [38,] 1.778649e-06 3.557298e-06 0.99999822 [39,] 1.556813e-06 3.113627e-06 0.99999844 [40,] 3.391522e-06 6.783044e-06 0.99999661 [41,] 1.582610e-05 3.165220e-05 0.99998417 [42,] 1.512787e-05 3.025574e-05 0.99998487 [43,] 1.322183e-05 2.644366e-05 0.99998678 [44,] 5.500168e-06 1.100034e-05 0.99999450 [45,] 3.229275e-06 6.458550e-06 0.99999677 [46,] 2.424988e-05 4.849977e-05 0.99997575 [47,] 1.078864e-03 2.157728e-03 0.99892114 [48,] 4.844973e-02 9.689945e-02 0.95155027 [49,] 1.153637e-01 2.307274e-01 0.88463631 [50,] 1.687150e-01 3.374300e-01 0.83128499 [51,] 7.741108e-01 4.517785e-01 0.22588923 [52,] 9.844727e-01 3.105459e-02 0.01552730 > postscript(file="/var/www/html/rcomp/tmp/1mqm61260816827.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2frj71260816827.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/3hwvt1260816827.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/41bpl1260816827.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5l1nb1260816827.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 61 Frequency = 1 1 2 3 4 5 6 3.18432997 1.92651801 3.59761203 3.50483852 3.12651801 3.24819749 7 8 9 10 11 12 2.44097100 2.61929151 0.30483852 -2.58793498 -3.05902900 -3.05902900 13 14 15 16 17 18 -0.25180251 -2.47348199 -3.48070849 -4.67348199 -3.46625550 -0.95902900 19 20 21 22 23 24 -0.37348199 1.81206502 1.59761203 4.19761203 2.89761203 5.61206502 25 26 27 28 29 30 3.33374450 5.85542399 4.06987698 4.26987698 5.66987698 4.26265048 31 32 33 34 35 36 3.04819749 1.54097100 1.84097100 3.14819749 3.04819749 2.36987698 37 38 39 40 41 42 3.09878296 3.59878296 5.31323595 4.32768894 2.91323595 2.21323595 43 44 45 46 47 48 1.99878296 1.38432997 3.49155646 2.71323595 4.62768894 2.94936842 49 50 51 52 53 54 3.93491543 0.69155646 -0.01567003 2.00600945 0.43491543 -2.65785807 55 56 57 58 59 60 -6.58676405 -12.53012302 -15.45180251 -16.95180251 -17.03012302 -16.00844354 61 -16.60844354 > postscript(file="/var/www/html/rcomp/tmp/6fw5q1260816827.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 61 Frequency = 1 lag(myerror, k = 1) myerror 0 3.18432997 NA 1 1.92651801 3.18432997 2 3.59761203 1.92651801 3 3.50483852 3.59761203 4 3.12651801 3.50483852 5 3.24819749 3.12651801 6 2.44097100 3.24819749 7 2.61929151 2.44097100 8 0.30483852 2.61929151 9 -2.58793498 0.30483852 10 -3.05902900 -2.58793498 11 -3.05902900 -3.05902900 12 -0.25180251 -3.05902900 13 -2.47348199 -0.25180251 14 -3.48070849 -2.47348199 15 -4.67348199 -3.48070849 16 -3.46625550 -4.67348199 17 -0.95902900 -3.46625550 18 -0.37348199 -0.95902900 19 1.81206502 -0.37348199 20 1.59761203 1.81206502 21 4.19761203 1.59761203 22 2.89761203 4.19761203 23 5.61206502 2.89761203 24 3.33374450 5.61206502 25 5.85542399 3.33374450 26 4.06987698 5.85542399 27 4.26987698 4.06987698 28 5.66987698 4.26987698 29 4.26265048 5.66987698 30 3.04819749 4.26265048 31 1.54097100 3.04819749 32 1.84097100 1.54097100 33 3.14819749 1.84097100 34 3.04819749 3.14819749 35 2.36987698 3.04819749 36 3.09878296 2.36987698 37 3.59878296 3.09878296 38 5.31323595 3.59878296 39 4.32768894 5.31323595 40 2.91323595 4.32768894 41 2.21323595 2.91323595 42 1.99878296 2.21323595 43 1.38432997 1.99878296 44 3.49155646 1.38432997 45 2.71323595 3.49155646 46 4.62768894 2.71323595 47 2.94936842 4.62768894 48 3.93491543 2.94936842 49 0.69155646 3.93491543 50 -0.01567003 0.69155646 51 2.00600945 -0.01567003 52 0.43491543 2.00600945 53 -2.65785807 0.43491543 54 -6.58676405 -2.65785807 55 -12.53012302 -6.58676405 56 -15.45180251 -12.53012302 57 -16.95180251 -15.45180251 58 -17.03012302 -16.95180251 59 -16.00844354 -17.03012302 60 -16.60844354 -16.00844354 61 NA -16.60844354 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 1.92651801 3.18432997 [2,] 3.59761203 1.92651801 [3,] 3.50483852 3.59761203 [4,] 3.12651801 3.50483852 [5,] 3.24819749 3.12651801 [6,] 2.44097100 3.24819749 [7,] 2.61929151 2.44097100 [8,] 0.30483852 2.61929151 [9,] -2.58793498 0.30483852 [10,] -3.05902900 -2.58793498 [11,] -3.05902900 -3.05902900 [12,] -0.25180251 -3.05902900 [13,] -2.47348199 -0.25180251 [14,] -3.48070849 -2.47348199 [15,] -4.67348199 -3.48070849 [16,] -3.46625550 -4.67348199 [17,] -0.95902900 -3.46625550 [18,] -0.37348199 -0.95902900 [19,] 1.81206502 -0.37348199 [20,] 1.59761203 1.81206502 [21,] 4.19761203 1.59761203 [22,] 2.89761203 4.19761203 [23,] 5.61206502 2.89761203 [24,] 3.33374450 5.61206502 [25,] 5.85542399 3.33374450 [26,] 4.06987698 5.85542399 [27,] 4.26987698 4.06987698 [28,] 5.66987698 4.26987698 [29,] 4.26265048 5.66987698 [30,] 3.04819749 4.26265048 [31,] 1.54097100 3.04819749 [32,] 1.84097100 1.54097100 [33,] 3.14819749 1.84097100 [34,] 3.04819749 3.14819749 [35,] 2.36987698 3.04819749 [36,] 3.09878296 2.36987698 [37,] 3.59878296 3.09878296 [38,] 5.31323595 3.59878296 [39,] 4.32768894 5.31323595 [40,] 2.91323595 4.32768894 [41,] 2.21323595 2.91323595 [42,] 1.99878296 2.21323595 [43,] 1.38432997 1.99878296 [44,] 3.49155646 1.38432997 [45,] 2.71323595 3.49155646 [46,] 4.62768894 2.71323595 [47,] 2.94936842 4.62768894 [48,] 3.93491543 2.94936842 [49,] 0.69155646 3.93491543 [50,] -0.01567003 0.69155646 [51,] 2.00600945 -0.01567003 [52,] 0.43491543 2.00600945 [53,] -2.65785807 0.43491543 [54,] -6.58676405 -2.65785807 [55,] -12.53012302 -6.58676405 [56,] -15.45180251 -12.53012302 [57,] -16.95180251 -15.45180251 [58,] -17.03012302 -16.95180251 [59,] -16.00844354 -17.03012302 [60,] -16.60844354 -16.00844354 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 1.92651801 3.18432997 2 3.59761203 1.92651801 3 3.50483852 3.59761203 4 3.12651801 3.50483852 5 3.24819749 3.12651801 6 2.44097100 3.24819749 7 2.61929151 2.44097100 8 0.30483852 2.61929151 9 -2.58793498 0.30483852 10 -3.05902900 -2.58793498 11 -3.05902900 -3.05902900 12 -0.25180251 -3.05902900 13 -2.47348199 -0.25180251 14 -3.48070849 -2.47348199 15 -4.67348199 -3.48070849 16 -3.46625550 -4.67348199 17 -0.95902900 -3.46625550 18 -0.37348199 -0.95902900 19 1.81206502 -0.37348199 20 1.59761203 1.81206502 21 4.19761203 1.59761203 22 2.89761203 4.19761203 23 5.61206502 2.89761203 24 3.33374450 5.61206502 25 5.85542399 3.33374450 26 4.06987698 5.85542399 27 4.26987698 4.06987698 28 5.66987698 4.26987698 29 4.26265048 5.66987698 30 3.04819749 4.26265048 31 1.54097100 3.04819749 32 1.84097100 1.54097100 33 3.14819749 1.84097100 34 3.04819749 3.14819749 35 2.36987698 3.04819749 36 3.09878296 2.36987698 37 3.59878296 3.09878296 38 5.31323595 3.59878296 39 4.32768894 5.31323595 40 2.91323595 4.32768894 41 2.21323595 2.91323595 42 1.99878296 2.21323595 43 1.38432997 1.99878296 44 3.49155646 1.38432997 45 2.71323595 3.49155646 46 4.62768894 2.71323595 47 2.94936842 4.62768894 48 3.93491543 2.94936842 49 0.69155646 3.93491543 50 -0.01567003 0.69155646 51 2.00600945 -0.01567003 52 0.43491543 2.00600945 53 -2.65785807 0.43491543 54 -6.58676405 -2.65785807 55 -12.53012302 -6.58676405 56 -15.45180251 -12.53012302 57 -16.95180251 -15.45180251 58 -17.03012302 -16.95180251 59 -16.00844354 -17.03012302 60 -16.60844354 -16.00844354 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/7kt9b1260816827.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/87w9e1260816827.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/9xs241260816827.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/rcomp/tmp/106y451260816827.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #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, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/11qpkz1260816827.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/12uqhj1260816827.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/13y7it1260816827.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/14se3a1260816827.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/html/rcomp/tmp/1589zb1260816827.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/www/html/rcomp/tmp/16vwx91260816827.tab") + } > > try(system("convert tmp/1mqm61260816827.ps tmp/1mqm61260816827.png",intern=TRUE)) character(0) > try(system("convert tmp/2frj71260816827.ps tmp/2frj71260816827.png",intern=TRUE)) character(0) > try(system("convert tmp/3hwvt1260816827.ps tmp/3hwvt1260816827.png",intern=TRUE)) character(0) > try(system("convert tmp/41bpl1260816827.ps tmp/41bpl1260816827.png",intern=TRUE)) character(0) > try(system("convert tmp/5l1nb1260816827.ps tmp/5l1nb1260816827.png",intern=TRUE)) character(0) > try(system("convert tmp/6fw5q1260816827.ps tmp/6fw5q1260816827.png",intern=TRUE)) character(0) > try(system("convert tmp/7kt9b1260816827.ps tmp/7kt9b1260816827.png",intern=TRUE)) character(0) > try(system("convert tmp/87w9e1260816827.ps tmp/87w9e1260816827.png",intern=TRUE)) character(0) > try(system("convert tmp/9xs241260816827.ps tmp/9xs241260816827.png",intern=TRUE)) character(0) > try(system("convert tmp/106y451260816827.ps tmp/106y451260816827.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.497 1.586 3.679