R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(141 + ,9.3 + ,16 + ,6 + ,7 + ,NA + ,136 + ,14.2 + ,20 + ,20 + ,0 + ,NA + ,246 + ,17.3 + ,7 + ,12 + ,0 + ,NA + ,309 + ,23 + ,8 + ,15 + ,0 + ,NA + ,95 + ,16.3 + ,21 + ,25 + ,0 + ,NA + ,161 + ,18.4 + ,7 + ,4 + ,0 + ,NA + ,108 + ,14.2 + ,17 + ,6 + ,0 + ,NA + ,79 + ,9.1 + ,20 + ,2 + ,0 + ,NA + ,40 + ,5.9 + ,18 + ,1 + ,1 + ,NA + ,35 + ,7.2 + ,26 + ,4 + ,2 + ,NA + ,49 + ,6.8 + ,18 + ,4 + ,2 + ,NA + ,145 + ,8 + ,20 + ,8 + ,2 + ,NA + ,284 + ,14.3 + ,0 + ,3 + ,0 + ,9.3 + ,164 + ,14.6 + ,22 + ,14 + ,0 + ,14.2 + ,130 + ,17.5 + ,19 + ,17 + ,0 + ,17.3 + ,178 + ,17.2 + ,18 + ,14 + ,0 + ,23 + ,150 + ,17.2 + ,13 + ,10 + ,0 + ,16.3 + ,104 + ,14.1 + ,16 + ,7 + ,0 + ,18.4 + ,111 + ,10.4 + ,11 + ,4 + ,0 + ,14.2 + ,51 + ,6.8 + ,22 + ,1 + ,1 + ,9.1 + ,70 + ,4.1 + ,19 + ,6 + ,0 + ,5.9 + ,42 + ,6.5 + ,23 + ,2 + ,1 + ,7.2 + ,126 + ,6.1 + ,11 + ,2 + ,0 + ,6.8 + ,68 + ,6.3 + ,24 + ,8 + ,7 + ,8 + ,135 + ,9.3 + ,14 + ,10 + ,0 + ,14.3 + ,231 + ,16.4 + ,11 + ,13 + ,0 + ,14.6 + ,185 + ,16.1 + ,17 + ,10 + ,0 + ,17.5 + ,181 + ,18 + ,20 + ,14 + ,0 + ,17.2 + ,138 + ,17.6 + ,19 + ,13 + ,0 + ,17.2 + ,158 + ,14 + ,12 + ,6 + ,0 + ,14.1 + ,122 + ,10.5 + ,19 + ,6 + ,2 + ,10.4 + ,40 + ,6.9 + ,26 + ,9 + ,3 + ,6.8 + ,62 + ,2.8 + ,13 + ,2 + ,5 + ,4.1 + ,89 + ,0.7 + ,12 + ,4 + ,5 + ,6.5 + ,33 + ,3.6 + ,20 + ,3 + ,7 + ,6.1 + ,150 + ,6.7 + ,15 + ,4 + ,2 + ,6.3 + ,196 + ,12.5 + ,15 + ,10 + ,0 + ,9.3 + ,196 + ,14.4 + ,17 + ,15 + ,0 + ,16.4 + ,225 + ,16.5 + ,11 + ,14 + ,0 + ,16.1 + ,213 + ,18.7 + ,20 + ,18 + ,0 + ,18 + ,258 + ,19.4 + ,9 + ,10 + ,0 + ,17.6 + ,156 + ,15.8 + ,10 + ,5 + ,0 + ,14 + ,90 + ,11.3 + ,17 + ,5 + ,0 + ,10.5 + ,48 + ,9.7 + ,25 + ,7 + ,0 + ,6.9 + ,46 + ,2.9 + ,19 + ,2 + ,7 + ,2.8 + ,49 + ,0.1 + ,18 + ,0 + ,14 + ,0.7 + ,29 + ,2.5 + ,24 + ,4 + ,10 + ,3.6 + ,118 + ,6.7 + ,13 + ,7 + ,2 + ,6.7 + ,223 + ,10.3 + ,6 + ,8 + ,0 + ,12.5 + ,172 + ,11.2 + ,14 + ,6 + ,0 + ,14.4 + ,259 + ,17.4 + ,9 + ,3 + ,0 + ,16.5 + ,252 + ,20.5 + ,13 + ,12 + ,0 + ,18.7 + ,136 + ,17 + ,23 + ,15 + ,0 + ,19.4 + ,143 + ,14.2 + ,18 + ,8 + ,0 + ,15.8 + ,119 + ,10.6 + ,16 + ,6 + ,0 + ,11.3 + ,24 + ,6.1 + ,21 + ,1 + ,6 + ,9.7) + ,dim=c(6 + ,56) + ,dimnames=list(c('UrenZonneschijn' + ,'GemiddeldeTemperatuur' + ,'Neerslagdagen' + ,'Onweersdagen' + ,'Sneeuwdagen' + ,'GemTemperatuurAuto') + ,1:56)) > y <- array(NA,dim=c(6,56),dimnames=list(c('UrenZonneschijn','GemiddeldeTemperatuur','Neerslagdagen','Onweersdagen','Sneeuwdagen','GemTemperatuurAuto'),1:56)) > 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 = '2' > #'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 > 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 GemiddeldeTemperatuur UrenZonneschijn Neerslagdagen Onweersdagen Sneeuwdagen 1 9.3 141 16 6 7 2 14.2 136 20 20 0 3 17.3 246 7 12 0 4 23.0 309 8 15 0 5 16.3 95 21 25 0 6 18.4 161 7 4 0 7 14.2 108 17 6 0 8 9.1 79 20 2 0 9 5.9 40 18 1 1 10 7.2 35 26 4 2 11 6.8 49 18 4 2 12 8.0 145 20 8 2 13 14.3 284 0 3 0 14 14.6 164 22 14 0 15 17.5 130 19 17 0 16 17.2 178 18 14 0 17 17.2 150 13 10 0 18 14.1 104 16 7 0 19 10.4 111 11 4 0 20 6.8 51 22 1 1 21 4.1 70 19 6 0 22 6.5 42 23 2 1 23 6.1 126 11 2 0 24 6.3 68 24 8 7 25 9.3 135 14 10 0 26 16.4 231 11 13 0 27 16.1 185 17 10 0 28 18.0 181 20 14 0 29 17.6 138 19 13 0 30 14.0 158 12 6 0 31 10.5 122 19 6 2 32 6.9 40 26 9 3 33 2.8 62 13 2 5 34 0.7 89 12 4 5 35 3.6 33 20 3 7 36 6.7 150 15 4 2 37 12.5 196 15 10 0 38 14.4 196 17 15 0 39 16.5 225 11 14 0 40 18.7 213 20 18 0 41 19.4 258 9 10 0 42 15.8 156 10 5 0 43 11.3 90 17 5 0 44 9.7 48 25 7 0 45 2.9 46 19 2 7 46 0.1 49 18 0 14 47 2.5 29 24 4 10 48 6.7 118 13 7 2 49 10.3 223 6 8 0 50 11.2 172 14 6 0 51 17.4 259 9 3 0 52 20.5 252 13 12 0 53 17.0 136 23 15 0 54 14.2 143 18 8 0 55 10.6 119 16 6 0 56 6.1 24 21 1 6 GemTemperatuurAuto 1 NA 2 NA 3 NA 4 NA 5 NA 6 NA 7 NA 8 NA 9 NA 10 NA 11 NA 12 NA 13 9.3 14 14.2 15 17.3 16 23.0 17 16.3 18 18.4 19 14.2 20 9.1 21 5.9 22 7.2 23 6.8 24 8.0 25 14.3 26 14.6 27 17.5 28 17.2 29 17.2 30 14.1 31 10.4 32 6.8 33 4.1 34 6.5 35 6.1 36 6.3 37 9.3 38 16.4 39 16.1 40 18.0 41 17.6 42 14.0 43 10.5 44 6.9 45 2.8 46 0.7 47 3.6 48 6.7 49 12.5 50 14.4 51 16.5 52 18.7 53 19.4 54 15.8 55 11.3 56 9.7 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) UrenZonneschijn Neerslagdagen Onweersdagen -4.045302 0.038144 0.213147 0.001013 Sneeuwdagen GemTemperatuurAuto -0.208606 0.587554 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -3.9874 -0.6995 0.0338 0.9501 3.5326 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -4.045302 2.255823 -1.793 0.080892 . UrenZonneschijn 0.038144 0.009171 4.159 0.000176 *** Neerslagdagen 0.213147 0.098636 2.161 0.037069 * Onweersdagen 0.001013 0.107129 0.009 0.992505 Sneeuwdagen -0.208606 0.123561 -1.688 0.099550 . GemTemperatuurAuto 0.587554 0.094520 6.216 2.88e-07 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.79 on 38 degrees of freedom (12 observations deleted due to missingness) Multiple R-squared: 0.9118, Adjusted R-squared: 0.9002 F-statistic: 78.59 on 5 and 38 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 + } Error in if (gqarr[mypoint - kp3 + 1, 2] < 0.01) numsignificant1 <- numsignificant1 + : missing value where TRUE/FALSE needed Execution halted