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(56.6,0,56,0,54.8,0,52.7,0,50.9,0,50.6,0,52.1,0,53.3,0,53.9,0,54.3,0,54.2,0,54.2,0,53.5,0,51.4,0,50.5,0,50.3,0,49.8,0,50.7,0,52.8,0,55.3,0,57.3,0,57.5,0,56.8,0,56.4,0,56.3,0,56.4,0,57,0,57.9,0,58.9,0,58.8,0,56.5,1,51.9,1,47.4,1,44.9,1,43.9,1,43.4,1,42.9,1,42.6,1,42.2,1,41.2,1,40.2,1,39.3,1,38.5,1,38.3,1,37.9,1,37.6,1,37.3,1,36,1,34.5,1,33.5,1,32.9,1,32.9,1,32.8,1,31.9,1,30.5,1,29.2,1,28.7,1,28.4,1,28,1,27.4,1,26.9,1),dim=c(2,61),dimnames=list(c('Y','X'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('Y','X'),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 Y X 1 56.6 0 2 56.0 0 3 54.8 0 4 52.7 0 5 50.9 0 6 50.6 0 7 52.1 0 8 53.3 0 9 53.9 0 10 54.3 0 11 54.2 0 12 54.2 0 13 53.5 0 14 51.4 0 15 50.5 0 16 50.3 0 17 49.8 0 18 50.7 0 19 52.8 0 20 55.3 0 21 57.3 0 22 57.5 0 23 56.8 0 24 56.4 0 25 56.3 0 26 56.4 0 27 57.0 0 28 57.9 0 29 58.9 0 30 58.8 0 31 56.5 1 32 51.9 1 33 47.4 1 34 44.9 1 35 43.9 1 36 43.4 1 37 42.9 1 38 42.6 1 39 42.2 1 40 41.2 1 41 40.2 1 42 39.3 1 43 38.5 1 44 38.3 1 45 37.9 1 46 37.6 1 47 37.3 1 48 36.0 1 49 34.5 1 50 33.5 1 51 32.9 1 52 32.9 1 53 32.8 1 54 31.9 1 55 30.5 1 56 29.2 1 57 28.7 1 58 28.4 1 59 28.0 1 60 27.4 1 61 26.9 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 54.37 -16.97 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -10.50645 -3.77333 -0.07333 2.79355 19.09355 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 54.373 1.015 53.57 <2e-16 *** X -16.967 1.424 -11.92 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 5.56 on 59 degrees of freedom Multiple R-squared: 0.7064, Adjusted R-squared: 0.7015 F-statistic: 142 on 1 and 59 DF, p-value: < 2.2e-16 > 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,] 1.212997e-01 2.425993e-01 0.878700337 [2,] 8.980635e-02 1.796127e-01 0.910193650 [3,] 4.142714e-02 8.285429e-02 0.958572856 [4,] 1.593694e-02 3.187389e-02 0.984063056 [5,] 5.793387e-03 1.158677e-02 0.994206613 [6,] 2.062990e-03 4.125979e-03 0.997937010 [7,] 6.820806e-04 1.364161e-03 0.999317919 [8,] 2.131747e-04 4.263495e-04 0.999786825 [9,] 6.111066e-05 1.222213e-04 0.999938889 [10,] 3.268996e-05 6.537991e-05 0.999967310 [11,] 2.791807e-05 5.583614e-05 0.999972082 [12,] 2.326417e-05 4.652834e-05 0.999976736 [13,] 2.352479e-05 4.704958e-05 0.999976475 [14,] 1.335563e-05 2.671127e-05 0.999986644 [15,] 4.540747e-06 9.081495e-06 0.999995459 [16,] 2.642442e-06 5.284884e-06 0.999997358 [17,] 4.512302e-06 9.024605e-06 0.999995488 [18,] 6.324243e-06 1.264849e-05 0.999993676 [19,] 4.989057e-06 9.978113e-06 0.999995011 [20,] 3.066025e-06 6.132050e-06 0.999996934 [21,] 1.722770e-06 3.445541e-06 0.999998277 [22,] 9.562189e-07 1.912438e-06 0.999999044 [23,] 6.252728e-07 1.250546e-06 0.999999375 [24,] 5.529775e-07 1.105955e-06 0.999999447 [25,] 6.959597e-07 1.391919e-06 0.999999304 [26,] 7.066852e-07 1.413370e-06 0.999999293 [27,] 4.645459e-06 9.290918e-06 0.999995355 [28,] 2.840730e-05 5.681461e-05 0.999971593 [29,] 1.714696e-04 3.429391e-04 0.999828530 [30,] 7.303221e-04 1.460644e-03 0.999269678 [31,] 2.082290e-03 4.164579e-03 0.997917710 [32,] 4.763564e-03 9.527129e-03 0.995236436 [33,] 9.875742e-03 1.975148e-02 0.990124258 [34,] 1.981586e-02 3.963172e-02 0.980184141 [35,] 3.968810e-02 7.937620e-02 0.960311898 [36,] 7.477774e-02 1.495555e-01 0.925222257 [37,] 1.290556e-01 2.581113e-01 0.870944358 [38,] 2.024589e-01 4.049177e-01 0.797541143 [39,] 2.898849e-01 5.797698e-01 0.710115076 [40,] 3.984517e-01 7.969034e-01 0.601548297 [41,] 5.237286e-01 9.525428e-01 0.476271391 [42,] 6.651737e-01 6.696525e-01 0.334826261 [43,] 8.121544e-01 3.756913e-01 0.187845642 [44,] 9.005619e-01 1.988763e-01 0.099438130 [45,] 9.378410e-01 1.243179e-01 0.062158966 [46,] 9.538104e-01 9.237913e-02 0.046189565 [47,] 9.614663e-01 7.706737e-02 0.038533684 [48,] 9.720801e-01 5.583972e-02 0.027919862 [49,] 9.864527e-01 2.709460e-02 0.013547302 [50,] 9.948271e-01 1.034578e-02 0.005172890 [51,] 9.967763e-01 6.447458e-03 0.003223729 [52,] 9.928568e-01 1.428643e-02 0.007143215 > postscript(file="/var/www/html/rcomp/tmp/1ildw1258647230.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/20gts1258647230.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/32lk41258647230.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/4bjue1258647230.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/5of2b1258647230.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 2.22666667 1.62666667 0.42666667 -1.67333333 -3.47333333 -3.77333333 7 8 9 10 11 12 -2.27333333 -1.07333333 -0.47333333 -0.07333333 -0.17333333 -0.17333333 13 14 15 16 17 18 -0.87333333 -2.97333333 -3.87333333 -4.07333333 -4.57333333 -3.67333333 19 20 21 22 23 24 -1.57333333 0.92666667 2.92666667 3.12666667 2.42666667 2.02666667 25 26 27 28 29 30 1.92666667 2.02666667 2.62666667 3.52666667 4.52666667 4.42666667 31 32 33 34 35 36 19.09354839 14.49354839 9.99354839 7.49354839 6.49354839 5.99354839 37 38 39 40 41 42 5.49354839 5.19354839 4.79354839 3.79354839 2.79354839 1.89354839 43 44 45 46 47 48 1.09354839 0.89354839 0.49354839 0.19354839 -0.10645161 -1.40645161 49 50 51 52 53 54 -2.90645161 -3.90645161 -4.50645161 -4.50645161 -4.60645161 -5.50645161 55 56 57 58 59 60 -6.90645161 -8.20645161 -8.70645161 -9.00645161 -9.40645161 -10.00645161 61 -10.50645161 > postscript(file="/var/www/html/rcomp/tmp/6o1jc1258647230.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 2.22666667 NA 1 1.62666667 2.22666667 2 0.42666667 1.62666667 3 -1.67333333 0.42666667 4 -3.47333333 -1.67333333 5 -3.77333333 -3.47333333 6 -2.27333333 -3.77333333 7 -1.07333333 -2.27333333 8 -0.47333333 -1.07333333 9 -0.07333333 -0.47333333 10 -0.17333333 -0.07333333 11 -0.17333333 -0.17333333 12 -0.87333333 -0.17333333 13 -2.97333333 -0.87333333 14 -3.87333333 -2.97333333 15 -4.07333333 -3.87333333 16 -4.57333333 -4.07333333 17 -3.67333333 -4.57333333 18 -1.57333333 -3.67333333 19 0.92666667 -1.57333333 20 2.92666667 0.92666667 21 3.12666667 2.92666667 22 2.42666667 3.12666667 23 2.02666667 2.42666667 24 1.92666667 2.02666667 25 2.02666667 1.92666667 26 2.62666667 2.02666667 27 3.52666667 2.62666667 28 4.52666667 3.52666667 29 4.42666667 4.52666667 30 19.09354839 4.42666667 31 14.49354839 19.09354839 32 9.99354839 14.49354839 33 7.49354839 9.99354839 34 6.49354839 7.49354839 35 5.99354839 6.49354839 36 5.49354839 5.99354839 37 5.19354839 5.49354839 38 4.79354839 5.19354839 39 3.79354839 4.79354839 40 2.79354839 3.79354839 41 1.89354839 2.79354839 42 1.09354839 1.89354839 43 0.89354839 1.09354839 44 0.49354839 0.89354839 45 0.19354839 0.49354839 46 -0.10645161 0.19354839 47 -1.40645161 -0.10645161 48 -2.90645161 -1.40645161 49 -3.90645161 -2.90645161 50 -4.50645161 -3.90645161 51 -4.50645161 -4.50645161 52 -4.60645161 -4.50645161 53 -5.50645161 -4.60645161 54 -6.90645161 -5.50645161 55 -8.20645161 -6.90645161 56 -8.70645161 -8.20645161 57 -9.00645161 -8.70645161 58 -9.40645161 -9.00645161 59 -10.00645161 -9.40645161 60 -10.50645161 -10.00645161 61 NA -10.50645161 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 1.62666667 2.22666667 [2,] 0.42666667 1.62666667 [3,] -1.67333333 0.42666667 [4,] -3.47333333 -1.67333333 [5,] -3.77333333 -3.47333333 [6,] -2.27333333 -3.77333333 [7,] -1.07333333 -2.27333333 [8,] -0.47333333 -1.07333333 [9,] -0.07333333 -0.47333333 [10,] -0.17333333 -0.07333333 [11,] -0.17333333 -0.17333333 [12,] -0.87333333 -0.17333333 [13,] -2.97333333 -0.87333333 [14,] -3.87333333 -2.97333333 [15,] -4.07333333 -3.87333333 [16,] -4.57333333 -4.07333333 [17,] -3.67333333 -4.57333333 [18,] -1.57333333 -3.67333333 [19,] 0.92666667 -1.57333333 [20,] 2.92666667 0.92666667 [21,] 3.12666667 2.92666667 [22,] 2.42666667 3.12666667 [23,] 2.02666667 2.42666667 [24,] 1.92666667 2.02666667 [25,] 2.02666667 1.92666667 [26,] 2.62666667 2.02666667 [27,] 3.52666667 2.62666667 [28,] 4.52666667 3.52666667 [29,] 4.42666667 4.52666667 [30,] 19.09354839 4.42666667 [31,] 14.49354839 19.09354839 [32,] 9.99354839 14.49354839 [33,] 7.49354839 9.99354839 [34,] 6.49354839 7.49354839 [35,] 5.99354839 6.49354839 [36,] 5.49354839 5.99354839 [37,] 5.19354839 5.49354839 [38,] 4.79354839 5.19354839 [39,] 3.79354839 4.79354839 [40,] 2.79354839 3.79354839 [41,] 1.89354839 2.79354839 [42,] 1.09354839 1.89354839 [43,] 0.89354839 1.09354839 [44,] 0.49354839 0.89354839 [45,] 0.19354839 0.49354839 [46,] -0.10645161 0.19354839 [47,] -1.40645161 -0.10645161 [48,] -2.90645161 -1.40645161 [49,] -3.90645161 -2.90645161 [50,] -4.50645161 -3.90645161 [51,] -4.50645161 -4.50645161 [52,] -4.60645161 -4.50645161 [53,] -5.50645161 -4.60645161 [54,] -6.90645161 -5.50645161 [55,] -8.20645161 -6.90645161 [56,] -8.70645161 -8.20645161 [57,] -9.00645161 -8.70645161 [58,] -9.40645161 -9.00645161 [59,] -10.00645161 -9.40645161 [60,] -10.50645161 -10.00645161 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 1.62666667 2.22666667 2 0.42666667 1.62666667 3 -1.67333333 0.42666667 4 -3.47333333 -1.67333333 5 -3.77333333 -3.47333333 6 -2.27333333 -3.77333333 7 -1.07333333 -2.27333333 8 -0.47333333 -1.07333333 9 -0.07333333 -0.47333333 10 -0.17333333 -0.07333333 11 -0.17333333 -0.17333333 12 -0.87333333 -0.17333333 13 -2.97333333 -0.87333333 14 -3.87333333 -2.97333333 15 -4.07333333 -3.87333333 16 -4.57333333 -4.07333333 17 -3.67333333 -4.57333333 18 -1.57333333 -3.67333333 19 0.92666667 -1.57333333 20 2.92666667 0.92666667 21 3.12666667 2.92666667 22 2.42666667 3.12666667 23 2.02666667 2.42666667 24 1.92666667 2.02666667 25 2.02666667 1.92666667 26 2.62666667 2.02666667 27 3.52666667 2.62666667 28 4.52666667 3.52666667 29 4.42666667 4.52666667 30 19.09354839 4.42666667 31 14.49354839 19.09354839 32 9.99354839 14.49354839 33 7.49354839 9.99354839 34 6.49354839 7.49354839 35 5.99354839 6.49354839 36 5.49354839 5.99354839 37 5.19354839 5.49354839 38 4.79354839 5.19354839 39 3.79354839 4.79354839 40 2.79354839 3.79354839 41 1.89354839 2.79354839 42 1.09354839 1.89354839 43 0.89354839 1.09354839 44 0.49354839 0.89354839 45 0.19354839 0.49354839 46 -0.10645161 0.19354839 47 -1.40645161 -0.10645161 48 -2.90645161 -1.40645161 49 -3.90645161 -2.90645161 50 -4.50645161 -3.90645161 51 -4.50645161 -4.50645161 52 -4.60645161 -4.50645161 53 -5.50645161 -4.60645161 54 -6.90645161 -5.50645161 55 -8.20645161 -6.90645161 56 -8.70645161 -8.20645161 57 -9.00645161 -8.70645161 58 -9.40645161 -9.00645161 59 -10.00645161 -9.40645161 60 -10.50645161 -10.00645161 > 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/7gqks1258647230.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/8cdef1258647230.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/9c9ww1258647230.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/101ion1258647230.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/11b2gl1258647230.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/12za421258647230.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/137iga1258647230.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/14it0c1258647230.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/152upt1258647230.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/16bhmx1258647230.tab") + } > > system("convert tmp/1ildw1258647230.ps tmp/1ildw1258647230.png") > system("convert tmp/20gts1258647230.ps tmp/20gts1258647230.png") > system("convert tmp/32lk41258647230.ps tmp/32lk41258647230.png") > system("convert tmp/4bjue1258647230.ps tmp/4bjue1258647230.png") > system("convert tmp/5of2b1258647230.ps tmp/5of2b1258647230.png") > system("convert tmp/6o1jc1258647230.ps tmp/6o1jc1258647230.png") > system("convert tmp/7gqks1258647230.ps tmp/7gqks1258647230.png") > system("convert tmp/8cdef1258647230.ps tmp/8cdef1258647230.png") > system("convert tmp/9c9ww1258647230.ps tmp/9c9ww1258647230.png") > system("convert tmp/101ion1258647230.ps tmp/101ion1258647230.png") > > > proc.time() user system elapsed 2.500 1.578 2.893