R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-pc-linux-gnu (32-bit) 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(1.66 + ,0.67 + ,0.38 + ,0.25 + ,0.07 + ,0.16 + ,0.34 + ,0.10 + ,0.07 + ,0.63 + ,0.45 + ,0.08 + ,0.27 + ,0.24 + ,0.91 + ,0.46 + ,0.76 + ,0.75 + ,1.55 + ,0.18 + ,0.72 + ,0.18 + ,0.27 + ,0.81 + ,0.39 + ,0.60 + ,0.58 + ,0.44 + ,0.06 + ,0.02 + ,0.28 + ,0.77 + ,0.05 + ,0.79 + ,0.80 + ,0.66 + ,-0.06 + ,0.25 + ,0.87 + ,0.23 + ,0.22 + ,0.03 + ,0.24 + ,0.88 + ,0.89 + ,0.92 + ,0.82 + ,0.22 + ,2.03 + ,0.22 + ,0.30 + ,0.32 + ,0.60 + ,0.31 + ,1.80 + ,0.10 + ,0.44 + ,0.28 + ,0.60 + ,0.87 + ,0.39 + ,0.08 + ,0.65 + ,0.40 + ,0.78 + ,0.28 + ,-0.68 + ,0.85 + ,0.28 + ,0.91 + ,0.90 + ,0.73 + ,1.00 + ,0.66 + ,0.43 + ,0.87 + ,0.70 + ,0.20 + ,1.69 + ,0.81 + ,0.72 + ,0.73 + ,0.38 + ,0.36 + ,1.25 + ,0.45 + ,0.96 + ,0.46 + ,0.51 + ,0.08 + ,0.93 + ,0.41 + ,0.75 + ,0.86 + ,0.62 + ,0.24 + ,0.22 + ,0.56 + ,0.86 + ,0.48 + ,0.81 + ,0.94 + ,0.46 + ,0.38 + ,0.47 + ,0.27 + ,0.96 + ,0.48 + ,-1.05 + ,0.32 + ,0.05 + ,0.37 + ,0.07 + ,0.58 + ,1.25 + ,0.74 + ,0.01 + ,0.95 + ,0.31 + ,0.03 + ,1.88 + ,0.32 + ,0.05 + ,0.02 + ,0.56 + ,0.15 + ,1.31 + ,0.88 + ,0.82 + ,0.60 + ,0.22 + ,0.22 + ,1.37 + ,0.85 + ,0.99 + ,0.57 + ,0.50 + ,0.48 + ,-1.22 + ,0.03 + ,0.10 + ,0.73 + ,0.85 + ,0.27 + ,-0.14 + ,0.11 + ,0.18 + ,0.21 + ,0.47 + ,0.68 + ,0.29 + ,0.16 + ,0.83 + ,0.70 + ,0.83 + ,0.16 + ,0.60 + ,0.63 + ,0.06 + ,0.02 + ,0.93 + ,0.67 + ,0.84 + ,0.90 + ,0.39 + ,0.67 + ,0.32 + ,0.70 + ,-2.13 + ,0.30 + ,0.17 + ,0.80 + ,0.39 + ,0.35 + ,1.30 + ,0.54 + ,0.39 + ,0.67 + ,0.64 + ,0.09 + ,1.25 + ,0.53 + ,0.31 + ,0.64 + ,0.86 + ,0.93 + ,1.54 + ,0.15 + ,0.30 + ,0.85 + ,0.68 + ,0.20 + ,1.58 + ,0.38 + ,0.26 + ,0.88 + ,0.89 + ,0.18 + ,1.20 + ,0.94 + ,0.01 + ,0.22 + ,0.63 + ,0.41 + ,1.81 + ,0.86 + ,0.95 + ,0.88 + ,0.42 + ,0.39 + ,-0.63 + ,0.53 + ,0.05 + ,0.89 + ,0.87 + ,0.89 + ,0.74 + ,1.00 + ,0.47 + ,0.84 + ,0.64 + ,0.03 + ,1.69 + ,0.74 + ,0.65 + ,0.31 + ,0.33 + ,0.14 + ,0.80 + ,0.03 + ,0.17 + ,0.13 + ,0.99 + ,0.77) + ,dim=c(6 + ,39) + ,dimnames=list(c('succes' + ,'kleding' + ,'socialevaardigheden' + ,'zelfzekerheid' + ,'testosteron' + ,'verzorgdheid') + ,1:39)) > y <- array(NA,dim=c(6,39),dimnames=list(c('succes','kleding','socialevaardigheden','zelfzekerheid','testosteron','verzorgdheid'),1:39)) > 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' > par3 <- 'No Linear Trend' > par2 <- 'Do not include Seasonal Dummies' > par1 <- '1' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 () > #Author: root > #To cite this work: Wessa P., (2013), Multiple Regression (v1.0.29) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_multipleregression.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > # > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following objects are masked from 'package:base': as.Date, 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 succes kleding socialevaardigheden zelfzekerheid testosteron verzorgdheid 1 1.66 0.67 0.38 0.25 0.07 0.16 2 0.34 0.10 0.07 0.63 0.45 0.08 3 0.27 0.24 0.91 0.46 0.76 0.75 4 1.55 0.18 0.72 0.18 0.27 0.81 5 0.39 0.60 0.58 0.44 0.06 0.02 6 0.28 0.77 0.05 0.79 0.80 0.66 7 -0.06 0.25 0.87 0.23 0.22 0.03 8 0.24 0.88 0.89 0.92 0.82 0.22 9 2.03 0.22 0.30 0.32 0.60 0.31 10 1.80 0.10 0.44 0.28 0.60 0.87 11 0.39 0.08 0.65 0.40 0.78 0.28 12 -0.68 0.85 0.28 0.91 0.90 0.73 13 1.00 0.66 0.43 0.87 0.70 0.20 14 1.69 0.81 0.72 0.73 0.38 0.36 15 1.25 0.45 0.96 0.46 0.51 0.08 16 0.93 0.41 0.75 0.86 0.62 0.24 17 0.22 0.56 0.86 0.48 0.81 0.94 18 0.46 0.38 0.47 0.27 0.96 0.48 19 -1.05 0.32 0.05 0.37 0.07 0.58 20 1.25 0.74 0.01 0.95 0.31 0.03 21 1.88 0.32 0.05 0.02 0.56 0.15 22 1.31 0.88 0.82 0.60 0.22 0.22 23 1.37 0.85 0.99 0.57 0.50 0.48 24 -1.22 0.03 0.10 0.73 0.85 0.27 25 -0.14 0.11 0.18 0.21 0.47 0.68 26 0.29 0.16 0.83 0.70 0.83 0.16 27 0.60 0.63 0.06 0.02 0.93 0.67 28 0.84 0.90 0.39 0.67 0.32 0.70 29 -2.13 0.30 0.17 0.80 0.39 0.35 30 1.30 0.54 0.39 0.67 0.64 0.09 31 1.25 0.53 0.31 0.64 0.86 0.93 32 1.54 0.15 0.30 0.85 0.68 0.20 33 1.58 0.38 0.26 0.88 0.89 0.18 34 1.20 0.94 0.01 0.22 0.63 0.41 35 1.81 0.86 0.95 0.88 0.42 0.39 36 -0.63 0.53 0.05 0.89 0.87 0.89 37 0.74 1.00 0.47 0.84 0.64 0.03 38 1.69 0.74 0.65 0.31 0.33 0.14 39 0.80 0.03 0.17 0.13 0.99 0.77 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) kleding socialevaardigheden 0.7539 0.9443 0.6088 zelfzekerheid testosteron verzorgdheid -1.2189 0.3260 -0.7341 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -2.16583 -0.53792 0.04696 0.60910 1.46812 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.7539 0.5473 1.377 0.1776 kleding 0.9443 0.5419 1.743 0.0907 . socialevaardigheden 0.6088 0.4647 1.310 0.1992 zelfzekerheid -1.2189 0.5935 -2.054 0.0480 * testosteron 0.3260 0.6305 0.517 0.6086 verzorgdheid -0.7341 0.5556 -1.321 0.1956 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.9054 on 33 degrees of freedom Multiple R-squared: 0.2104, Adjusted R-squared: 0.09072 F-statistic: 1.758 on 5 and 33 DF, p-value: 0.1489 > 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,] 0.4896069 0.9792138 0.5103931 [2,] 0.4172174 0.8344348 0.5827826 [3,] 0.3072659 0.6145317 0.6927341 [4,] 0.3828555 0.7657110 0.6171445 [5,] 0.4575708 0.9151417 0.5424292 [6,] 0.5619927 0.8760147 0.4380073 [7,] 0.4794562 0.9589123 0.5205438 [8,] 0.4053629 0.8107259 0.5946371 [9,] 0.3323848 0.6647696 0.6676152 [10,] 0.2613108 0.5226216 0.7386892 [11,] 0.4452342 0.8904683 0.5547658 [12,] 0.4464775 0.8929550 0.5535225 [13,] 0.4466395 0.8932790 0.5533605 [14,] 0.3471759 0.6943518 0.6528241 [15,] 0.2826441 0.5652882 0.7173559 [16,] 0.3153751 0.6307502 0.6846249 [17,] 0.2346724 0.4693449 0.7653276 [18,] 0.3445643 0.6891287 0.6554357 [19,] 0.3015989 0.6031978 0.6984011 [20,] 0.3278360 0.6556720 0.6721640 [21,] 0.6829013 0.6341974 0.3170987 [22,] 0.5218016 0.9563969 0.4781984 > postscript(file="/var/fisher/rcomp/tmp/191ik1384719625.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/2vil41384719625.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/3n5ff1384719625.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/4kwfg1384719625.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/59n1g1384719625.ps",horizontal=F,onefile=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 = 39 Frequency = 1 1 2 3 4 5 6 0.44138193 0.12894602 -0.40106030 0.91374630 -0.75219844 -0.04487525 7 8 9 10 11 12 -1.34900727 -0.87118477 1.30770358 1.46811700 -0.39635013 -1.05538715 13 14 15 16 17 18 0.34009447 0.76301513 -0.06014508 0.35461391 -0.57524972 -0.57037423 19 20 21 22 23 24 -1.28263571 0.87007612 0.74539502 0.04696493 0.09482721 -1.25223641 25 26 27 28 29 30 -0.50546287 -0.42020317 -0.57231697 0.22493387 -2.16583265 0.47280045 31 32 33 34 35 36 0.98928984 1.42297975 1.22357256 -0.08391604 0.88759299 -0.46033318 37 38 39 -0.40712544 0.21461138 0.31523234 > postscript(file="/var/fisher/rcomp/tmp/6j9t11384719625.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 39 Frequency = 1 lag(myerror, k = 1) myerror 0 0.44138193 NA 1 0.12894602 0.44138193 2 -0.40106030 0.12894602 3 0.91374630 -0.40106030 4 -0.75219844 0.91374630 5 -0.04487525 -0.75219844 6 -1.34900727 -0.04487525 7 -0.87118477 -1.34900727 8 1.30770358 -0.87118477 9 1.46811700 1.30770358 10 -0.39635013 1.46811700 11 -1.05538715 -0.39635013 12 0.34009447 -1.05538715 13 0.76301513 0.34009447 14 -0.06014508 0.76301513 15 0.35461391 -0.06014508 16 -0.57524972 0.35461391 17 -0.57037423 -0.57524972 18 -1.28263571 -0.57037423 19 0.87007612 -1.28263571 20 0.74539502 0.87007612 21 0.04696493 0.74539502 22 0.09482721 0.04696493 23 -1.25223641 0.09482721 24 -0.50546287 -1.25223641 25 -0.42020317 -0.50546287 26 -0.57231697 -0.42020317 27 0.22493387 -0.57231697 28 -2.16583265 0.22493387 29 0.47280045 -2.16583265 30 0.98928984 0.47280045 31 1.42297975 0.98928984 32 1.22357256 1.42297975 33 -0.08391604 1.22357256 34 0.88759299 -0.08391604 35 -0.46033318 0.88759299 36 -0.40712544 -0.46033318 37 0.21461138 -0.40712544 38 0.31523234 0.21461138 39 NA 0.31523234 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.12894602 0.44138193 [2,] -0.40106030 0.12894602 [3,] 0.91374630 -0.40106030 [4,] -0.75219844 0.91374630 [5,] -0.04487525 -0.75219844 [6,] -1.34900727 -0.04487525 [7,] -0.87118477 -1.34900727 [8,] 1.30770358 -0.87118477 [9,] 1.46811700 1.30770358 [10,] -0.39635013 1.46811700 [11,] -1.05538715 -0.39635013 [12,] 0.34009447 -1.05538715 [13,] 0.76301513 0.34009447 [14,] -0.06014508 0.76301513 [15,] 0.35461391 -0.06014508 [16,] -0.57524972 0.35461391 [17,] -0.57037423 -0.57524972 [18,] -1.28263571 -0.57037423 [19,] 0.87007612 -1.28263571 [20,] 0.74539502 0.87007612 [21,] 0.04696493 0.74539502 [22,] 0.09482721 0.04696493 [23,] -1.25223641 0.09482721 [24,] -0.50546287 -1.25223641 [25,] -0.42020317 -0.50546287 [26,] -0.57231697 -0.42020317 [27,] 0.22493387 -0.57231697 [28,] -2.16583265 0.22493387 [29,] 0.47280045 -2.16583265 [30,] 0.98928984 0.47280045 [31,] 1.42297975 0.98928984 [32,] 1.22357256 1.42297975 [33,] -0.08391604 1.22357256 [34,] 0.88759299 -0.08391604 [35,] -0.46033318 0.88759299 [36,] -0.40712544 -0.46033318 [37,] 0.21461138 -0.40712544 [38,] 0.31523234 0.21461138 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.12894602 0.44138193 2 -0.40106030 0.12894602 3 0.91374630 -0.40106030 4 -0.75219844 0.91374630 5 -0.04487525 -0.75219844 6 -1.34900727 -0.04487525 7 -0.87118477 -1.34900727 8 1.30770358 -0.87118477 9 1.46811700 1.30770358 10 -0.39635013 1.46811700 11 -1.05538715 -0.39635013 12 0.34009447 -1.05538715 13 0.76301513 0.34009447 14 -0.06014508 0.76301513 15 0.35461391 -0.06014508 16 -0.57524972 0.35461391 17 -0.57037423 -0.57524972 18 -1.28263571 -0.57037423 19 0.87007612 -1.28263571 20 0.74539502 0.87007612 21 0.04696493 0.74539502 22 0.09482721 0.04696493 23 -1.25223641 0.09482721 24 -0.50546287 -1.25223641 25 -0.42020317 -0.50546287 26 -0.57231697 -0.42020317 27 0.22493387 -0.57231697 28 -2.16583265 0.22493387 29 0.47280045 -2.16583265 30 0.98928984 0.47280045 31 1.42297975 0.98928984 32 1.22357256 1.42297975 33 -0.08391604 1.22357256 34 0.88759299 -0.08391604 35 -0.46033318 0.88759299 36 -0.40712544 -0.46033318 37 0.21461138 -0.40712544 38 0.31523234 0.21461138 > 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/fisher/rcomp/tmp/7j7x91384719625.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/8eu8o1384719625.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/9ca4t1384719625.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/10u16l1384719625.ps",horizontal=F,onefile=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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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, signif(mysum$coefficients[i,1],6), 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/fisher/rcomp/tmp/11zi6z1384719625.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,signif(mysum$coefficients[i,1],6)) + a<-table.element(a, signif(mysum$coefficients[i,2],6)) + a<-table.element(a, signif(mysum$coefficients[i,3],4)) + a<-table.element(a, signif(mysum$coefficients[i,4],6)) + a<-table.element(a, signif(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/12wv4e1384719625.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, signif(sqrt(mysum$r.squared),6)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, signif(mysum$r.squared,6)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, signif(mysum$adj.r.squared,6)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, signif(mysum$fstatistic[1],6)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, signif(mysum$fstatistic[2],6)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, signif(mysum$fstatistic[3],6)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, signif(1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]),6)) > 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, signif(mysum$sigma,6)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, signif(sum(myerror*myerror),6)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/13kwvq1384719625.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,signif(x[i],6)) + a<-table.element(a,signif(x[i]-mysum$resid[i],6)) + a<-table.element(a,signif(mysum$resid[i],6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/14ccjm1384719625.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,signif(gqarr[mypoint-kp3+1,1],6)) + a<-table.element(a,signif(gqarr[mypoint-kp3+1,2],6)) + a<-table.element(a,signif(gqarr[mypoint-kp3+1,3],6)) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/fisher/rcomp/tmp/15ne0r1384719625.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,signif(numsignificant1,6)) + a<-table.element(a,signif(numsignificant1/numgqtests,6)) + 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,signif(numsignificant5,6)) + a<-table.element(a,signif(numsignificant5/numgqtests,6)) + 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,signif(numsignificant10,6)) + a<-table.element(a,signif(numsignificant10/numgqtests,6)) + 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/fisher/rcomp/tmp/16xs8q1384719626.tab") + } > > try(system("convert tmp/191ik1384719625.ps tmp/191ik1384719625.png",intern=TRUE)) character(0) > try(system("convert tmp/2vil41384719625.ps tmp/2vil41384719625.png",intern=TRUE)) character(0) > try(system("convert tmp/3n5ff1384719625.ps tmp/3n5ff1384719625.png",intern=TRUE)) character(0) > try(system("convert tmp/4kwfg1384719625.ps tmp/4kwfg1384719625.png",intern=TRUE)) character(0) > try(system("convert tmp/59n1g1384719625.ps tmp/59n1g1384719625.png",intern=TRUE)) character(0) > try(system("convert tmp/6j9t11384719625.ps tmp/6j9t11384719625.png",intern=TRUE)) character(0) > try(system("convert tmp/7j7x91384719625.ps tmp/7j7x91384719625.png",intern=TRUE)) character(0) > try(system("convert tmp/8eu8o1384719625.ps tmp/8eu8o1384719625.png",intern=TRUE)) character(0) > try(system("convert tmp/9ca4t1384719625.ps tmp/9ca4t1384719625.png",intern=TRUE)) character(0) > try(system("convert tmp/10u16l1384719625.ps tmp/10u16l1384719625.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.500 1.212 6.717