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(8.00,96.80,8.10,114.10,7.70,110.30,7.50,103.90,7.60,101.60,7.80,94.60,7.80,95.90,7.80,104.70,7.50,102.80,7.50,98.10,7.10,113.90,7.50,80.90,7.50,95.70,7.60,113.20,7.70,105.90,7.70,108.80,7.90,102.30,8.10,99.00,8.20,100.70,8.20,115.50,8.20,100.70,7.90,109.90,7.30,114.60,6.90,85.40,6.60,100.50,6.70,114.80,6.90,116.50,7.00,112.90,7.10,102.00,7.20,106.00,7.10,105.30,6.90,118.80,7.00,106.10,6.80,109.30,6.40,117.20,6.70,92.50,6.60,104.20,6.40,112.50,6.30,122.40,6.20,113.30,6.50,100.00,6.80,110.70,6.80,112.80,6.40,109.80,6.10,117.30,5.80,109.10,6.10,115.90,7.20,96.00,7.30,99.80,6.90,116.80,6.10,115.70,5.80,99.40,6.20,94.30,7.10,91.00,7.70,93.20,7.90,103.10,7.70,94.10,7.40,91.80,7.50,102.70,8.00,82.60),dim=c(2,60),dimnames=list(c('Wman','Ecogr'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Wman','Ecogr'),1:60)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = '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 Wman Ecogr t 1 8.0 96.8 1 2 8.1 114.1 2 3 7.7 110.3 3 4 7.5 103.9 4 5 7.6 101.6 5 6 7.8 94.6 6 7 7.8 95.9 7 8 7.8 104.7 8 9 7.5 102.8 9 10 7.5 98.1 10 11 7.1 113.9 11 12 7.5 80.9 12 13 7.5 95.7 13 14 7.6 113.2 14 15 7.7 105.9 15 16 7.7 108.8 16 17 7.9 102.3 17 18 8.1 99.0 18 19 8.2 100.7 19 20 8.2 115.5 20 21 8.2 100.7 21 22 7.9 109.9 22 23 7.3 114.6 23 24 6.9 85.4 24 25 6.6 100.5 25 26 6.7 114.8 26 27 6.9 116.5 27 28 7.0 112.9 28 29 7.1 102.0 29 30 7.2 106.0 30 31 7.1 105.3 31 32 6.9 118.8 32 33 7.0 106.1 33 34 6.8 109.3 34 35 6.4 117.2 35 36 6.7 92.5 36 37 6.6 104.2 37 38 6.4 112.5 38 39 6.3 122.4 39 40 6.2 113.3 40 41 6.5 100.0 41 42 6.8 110.7 42 43 6.8 112.8 43 44 6.4 109.8 44 45 6.1 117.3 45 46 5.8 109.1 46 47 6.1 115.9 47 48 7.2 96.0 48 49 7.3 99.8 49 50 6.9 116.8 50 51 6.1 115.7 51 52 5.8 99.4 52 53 6.2 94.3 53 54 7.1 91.0 54 55 7.7 93.2 55 56 7.9 103.1 56 57 7.7 94.1 57 58 7.4 91.8 58 59 7.5 102.7 59 60 8.0 82.6 60 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Ecogr t 10.41641 -0.02538 -0.01929 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.09058 -0.37020 -0.04225 0.35573 1.18047 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 10.416406 0.777349 13.400 < 2e-16 *** Ecogr -0.025382 0.007259 -3.497 0.00092 *** t -0.019285 0.003934 -4.902 8.25e-06 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.5273 on 57 degrees of freedom Multiple R-squared: 0.3791, Adjusted R-squared: 0.3573 F-statistic: 17.4 on 2 and 57 DF, p-value: 1.263e-06 > 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.0903249972 0.1806499943 0.9096750 [2,] 0.0454168658 0.0908337315 0.9545831 [3,] 0.0204064333 0.0408128666 0.9795936 [4,] 0.0078568123 0.0157136247 0.9921432 [5,] 0.0025398686 0.0050797373 0.9974601 [6,] 0.0016879962 0.0033759924 0.9983120 [7,] 0.0006049416 0.0012098833 0.9993951 [8,] 0.0002689798 0.0005379597 0.9997310 [9,] 0.0003468753 0.0006937506 0.9996531 [10,] 0.0003267489 0.0006534977 0.9996733 [11,] 0.0002250758 0.0004501516 0.9997749 [12,] 0.0003139500 0.0006279001 0.9996860 [13,] 0.0007255272 0.0014510544 0.9992745 [14,] 0.0014775801 0.0029551601 0.9985224 [15,] 0.0033197959 0.0066395919 0.9966802 [16,] 0.0047218066 0.0094436132 0.9952782 [17,] 0.0056259850 0.0112519699 0.9943740 [18,] 0.0142707688 0.0285415376 0.9857292 [19,] 0.0462346647 0.0924693295 0.9537653 [20,] 0.1416253245 0.2832506490 0.8583747 [21,] 0.2020393733 0.4040787466 0.7979606 [22,] 0.1988653894 0.3977307788 0.8011346 [23,] 0.1760251848 0.3520503695 0.8239748 [24,] 0.1358983586 0.2717967172 0.8641016 [25,] 0.1164526668 0.2329053336 0.8835473 [26,] 0.0975141129 0.1950282258 0.9024859 [27,] 0.1062514939 0.2125029877 0.8937485 [28,] 0.0967984003 0.1935968006 0.9032016 [29,] 0.0896265432 0.1792530863 0.9103735 [30,] 0.0936439053 0.1872878106 0.9063561 [31,] 0.0675378509 0.1350757017 0.9324621 [32,] 0.0509974360 0.1019948720 0.9490026 [33,] 0.0411233287 0.0822466575 0.9588767 [34,] 0.0358562702 0.0717125404 0.9641437 [35,] 0.0272169197 0.0544338393 0.9727831 [36,] 0.0168528911 0.0337057821 0.9831471 [37,] 0.0178642549 0.0357285098 0.9821357 [38,] 0.0251530290 0.0503060579 0.9748470 [39,] 0.0182293099 0.0364586198 0.9817707 [40,] 0.0121163587 0.0242327174 0.9878836 [41,] 0.0122858683 0.0245717366 0.9877141 [42,] 0.0071944461 0.0143888921 0.9928056 [43,] 0.0160594809 0.0321189619 0.9839405 [44,] 0.1033071567 0.2066143134 0.8966928 [45,] 0.1942795393 0.3885590786 0.8057205 [46,] 0.1262877629 0.2525755257 0.8737122 [47,] 0.2230439846 0.4460879693 0.7769560 [48,] 0.6064760152 0.7870479697 0.3935240 [49,] 0.7219081430 0.5561837140 0.2780919 > postscript(file="/var/www/html/rcomp/tmp/1lees1259169834.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/2l1xl1259169834.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/3c8131259169834.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/4u0kh1259169834.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/5tqwa1259169834.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 = 60 Frequency = 1 1 2 3 4 5 6 0.059866874 0.618262656 0.141096129 -0.202063858 -0.141157236 -0.099546483 7 8 9 10 11 12 -0.047264300 0.195383632 -0.133556906 -0.233567323 -0.213244691 -0.631568537 13 14 15 16 17 18 -0.236628005 0.326844197 0.260840319 0.353733862 0.408035665 0.543560187 19 20 21 22 23 24 0.705995210 1.100935742 0.744566115 0.697366887 0.235948209 -0.885923657 25 26 27 28 29 30 -0.783368495 -0.301119013 -0.038683991 -0.010774098 -0.168153535 0.052660317 31 32 33 34 35 36 -0.045821700 0.116122102 -0.086945115 -0.186436943 -0.366632900 -0.674285317 37 38 39 40 41 42 -0.458029295 -0.428072413 -0.257504171 -0.569195828 -0.587492304 0.003381618 43 44 45 46 47 48 0.075969480 -0.380891367 -0.471240165 -0.960087932 -0.468204200 0.145977464 49 50 51 52 53 54 0.361714896 0.412496048 -0.396138810 -1.090581586 -0.800744844 0.034779679 55 56 57 58 59 60 0.709905752 1.180473994 0.771320547 0.432227169 0.828177511 0.837282755 > postscript(file="/var/www/html/rcomp/tmp/6eygs1259169834.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 = 60 Frequency = 1 lag(myerror, k = 1) myerror 0 0.059866874 NA 1 0.618262656 0.059866874 2 0.141096129 0.618262656 3 -0.202063858 0.141096129 4 -0.141157236 -0.202063858 5 -0.099546483 -0.141157236 6 -0.047264300 -0.099546483 7 0.195383632 -0.047264300 8 -0.133556906 0.195383632 9 -0.233567323 -0.133556906 10 -0.213244691 -0.233567323 11 -0.631568537 -0.213244691 12 -0.236628005 -0.631568537 13 0.326844197 -0.236628005 14 0.260840319 0.326844197 15 0.353733862 0.260840319 16 0.408035665 0.353733862 17 0.543560187 0.408035665 18 0.705995210 0.543560187 19 1.100935742 0.705995210 20 0.744566115 1.100935742 21 0.697366887 0.744566115 22 0.235948209 0.697366887 23 -0.885923657 0.235948209 24 -0.783368495 -0.885923657 25 -0.301119013 -0.783368495 26 -0.038683991 -0.301119013 27 -0.010774098 -0.038683991 28 -0.168153535 -0.010774098 29 0.052660317 -0.168153535 30 -0.045821700 0.052660317 31 0.116122102 -0.045821700 32 -0.086945115 0.116122102 33 -0.186436943 -0.086945115 34 -0.366632900 -0.186436943 35 -0.674285317 -0.366632900 36 -0.458029295 -0.674285317 37 -0.428072413 -0.458029295 38 -0.257504171 -0.428072413 39 -0.569195828 -0.257504171 40 -0.587492304 -0.569195828 41 0.003381618 -0.587492304 42 0.075969480 0.003381618 43 -0.380891367 0.075969480 44 -0.471240165 -0.380891367 45 -0.960087932 -0.471240165 46 -0.468204200 -0.960087932 47 0.145977464 -0.468204200 48 0.361714896 0.145977464 49 0.412496048 0.361714896 50 -0.396138810 0.412496048 51 -1.090581586 -0.396138810 52 -0.800744844 -1.090581586 53 0.034779679 -0.800744844 54 0.709905752 0.034779679 55 1.180473994 0.709905752 56 0.771320547 1.180473994 57 0.432227169 0.771320547 58 0.828177511 0.432227169 59 0.837282755 0.828177511 60 NA 0.837282755 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.618262656 0.059866874 [2,] 0.141096129 0.618262656 [3,] -0.202063858 0.141096129 [4,] -0.141157236 -0.202063858 [5,] -0.099546483 -0.141157236 [6,] -0.047264300 -0.099546483 [7,] 0.195383632 -0.047264300 [8,] -0.133556906 0.195383632 [9,] -0.233567323 -0.133556906 [10,] -0.213244691 -0.233567323 [11,] -0.631568537 -0.213244691 [12,] -0.236628005 -0.631568537 [13,] 0.326844197 -0.236628005 [14,] 0.260840319 0.326844197 [15,] 0.353733862 0.260840319 [16,] 0.408035665 0.353733862 [17,] 0.543560187 0.408035665 [18,] 0.705995210 0.543560187 [19,] 1.100935742 0.705995210 [20,] 0.744566115 1.100935742 [21,] 0.697366887 0.744566115 [22,] 0.235948209 0.697366887 [23,] -0.885923657 0.235948209 [24,] -0.783368495 -0.885923657 [25,] -0.301119013 -0.783368495 [26,] -0.038683991 -0.301119013 [27,] -0.010774098 -0.038683991 [28,] -0.168153535 -0.010774098 [29,] 0.052660317 -0.168153535 [30,] -0.045821700 0.052660317 [31,] 0.116122102 -0.045821700 [32,] -0.086945115 0.116122102 [33,] -0.186436943 -0.086945115 [34,] -0.366632900 -0.186436943 [35,] -0.674285317 -0.366632900 [36,] -0.458029295 -0.674285317 [37,] -0.428072413 -0.458029295 [38,] -0.257504171 -0.428072413 [39,] -0.569195828 -0.257504171 [40,] -0.587492304 -0.569195828 [41,] 0.003381618 -0.587492304 [42,] 0.075969480 0.003381618 [43,] -0.380891367 0.075969480 [44,] -0.471240165 -0.380891367 [45,] -0.960087932 -0.471240165 [46,] -0.468204200 -0.960087932 [47,] 0.145977464 -0.468204200 [48,] 0.361714896 0.145977464 [49,] 0.412496048 0.361714896 [50,] -0.396138810 0.412496048 [51,] -1.090581586 -0.396138810 [52,] -0.800744844 -1.090581586 [53,] 0.034779679 -0.800744844 [54,] 0.709905752 0.034779679 [55,] 1.180473994 0.709905752 [56,] 0.771320547 1.180473994 [57,] 0.432227169 0.771320547 [58,] 0.828177511 0.432227169 [59,] 0.837282755 0.828177511 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.618262656 0.059866874 2 0.141096129 0.618262656 3 -0.202063858 0.141096129 4 -0.141157236 -0.202063858 5 -0.099546483 -0.141157236 6 -0.047264300 -0.099546483 7 0.195383632 -0.047264300 8 -0.133556906 0.195383632 9 -0.233567323 -0.133556906 10 -0.213244691 -0.233567323 11 -0.631568537 -0.213244691 12 -0.236628005 -0.631568537 13 0.326844197 -0.236628005 14 0.260840319 0.326844197 15 0.353733862 0.260840319 16 0.408035665 0.353733862 17 0.543560187 0.408035665 18 0.705995210 0.543560187 19 1.100935742 0.705995210 20 0.744566115 1.100935742 21 0.697366887 0.744566115 22 0.235948209 0.697366887 23 -0.885923657 0.235948209 24 -0.783368495 -0.885923657 25 -0.301119013 -0.783368495 26 -0.038683991 -0.301119013 27 -0.010774098 -0.038683991 28 -0.168153535 -0.010774098 29 0.052660317 -0.168153535 30 -0.045821700 0.052660317 31 0.116122102 -0.045821700 32 -0.086945115 0.116122102 33 -0.186436943 -0.086945115 34 -0.366632900 -0.186436943 35 -0.674285317 -0.366632900 36 -0.458029295 -0.674285317 37 -0.428072413 -0.458029295 38 -0.257504171 -0.428072413 39 -0.569195828 -0.257504171 40 -0.587492304 -0.569195828 41 0.003381618 -0.587492304 42 0.075969480 0.003381618 43 -0.380891367 0.075969480 44 -0.471240165 -0.380891367 45 -0.960087932 -0.471240165 46 -0.468204200 -0.960087932 47 0.145977464 -0.468204200 48 0.361714896 0.145977464 49 0.412496048 0.361714896 50 -0.396138810 0.412496048 51 -1.090581586 -0.396138810 52 -0.800744844 -1.090581586 53 0.034779679 -0.800744844 54 0.709905752 0.034779679 55 1.180473994 0.709905752 56 0.771320547 1.180473994 57 0.432227169 0.771320547 58 0.828177511 0.432227169 59 0.837282755 0.828177511 > 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/7c7961259169834.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/8d9vx1259169834.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/9oghb1259169834.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/108ctw1259169834.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/118nij1259169834.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/1283o71259169834.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/13a2c91259169834.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/14yzbh1259169834.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/15zqoq1259169835.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/16k8n81259169835.tab") + } > system("convert tmp/1lees1259169834.ps tmp/1lees1259169834.png") > system("convert tmp/2l1xl1259169834.ps tmp/2l1xl1259169834.png") > system("convert tmp/3c8131259169834.ps tmp/3c8131259169834.png") > system("convert tmp/4u0kh1259169834.ps tmp/4u0kh1259169834.png") > system("convert tmp/5tqwa1259169834.ps tmp/5tqwa1259169834.png") > system("convert tmp/6eygs1259169834.ps tmp/6eygs1259169834.png") > system("convert tmp/7c7961259169834.ps tmp/7c7961259169834.png") > system("convert tmp/8d9vx1259169834.ps tmp/8d9vx1259169834.png") > system("convert tmp/9oghb1259169834.ps tmp/9oghb1259169834.png") > system("convert tmp/108ctw1259169834.ps tmp/108ctw1259169834.png") > > > proc.time() user system elapsed 2.388 1.622 2.960