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(NA + ,3.00 + ,2.809559715 + ,0.301029996 + ,3.00 + ,1.62324929 + ,NA + ,1.00 + ,1.77815125 + ,NA + ,3.00 + ,1.397940009 + ,0.255272505 + ,4.00 + ,2.79518459 + ,-0.15490196 + ,4.00 + ,2.255272505 + ,0.591064607 + ,1.00 + ,1.544068044 + ,0 + ,4.00 + ,2.593286067 + ,0.556302501 + ,1.00 + ,1.799340549 + ,0.146128036 + ,1.00 + ,2.361727836 + ,0.176091259 + ,4.00 + ,2.049218023 + ,-0.15490196 + ,5.00 + ,2.44870632 + ,0.431363764 + ,2.00 + ,NA + ,NA + ,5.00 + ,2.562292864 + ,0.322219295 + ,1.00 + ,1.62324929 + ,NA + ,2.00 + ,1.447158031 + ,0.612783857 + ,2.00 + ,1.62324929 + ,0.079181246 + ,2.00 + ,2.079181246 + ,0.113943352 + ,1.00 + ,NA + ,0.785329835 + ,1.00 + ,NA + ,-0.522878745 + ,5.00 + ,2.602059991 + ,-0.301029996 + ,5.00 + ,2.170261715 + ,0.531478917 + ,2.00 + ,1.204119983 + ,NA + ,1.00 + ,2.401400541 + ,0.176091259 + ,1.00 + ,2.491361694 + ,NA + ,1.00 + ,1.799340549 + ,0.531478917 + ,3.00 + ,1.447158031 + ,-0.096910013 + ,4.00 + ,1.832508913 + ,-0.096910013 + ,5.00 + ,2.526339277 + ,NA + ,1.00 + ,2 + ,NA + ,4.00 + ,1.51851394 + ,0.146128036 + ,4.00 + ,1.33243846 + ,0.301029996 + ,1.00 + ,1.698970004 + ,0.278753601 + ,1.00 + ,2.426511261 + ,0.380211242 + ,1.00 + ,1.477121255 + ,0.447158031 + ,3.00 + ,1.653212514 + ,0.113943352 + ,3.00 + ,1.278753601 + ,0.301029996 + ,3.00 + ,1.477121255 + ,0.748188027 + ,1.00 + ,1.079181246 + ,0.491361694 + ,1.00 + ,2.079181246 + ,0 + ,5.00 + ,2.643452676 + ,0.255272505 + ,2.00 + ,2.146128036 + ,-0.045757491 + ,4.00 + ,2.230448921 + ,0.255272505 + ,2.00 + ,1.230448921 + ,0.278753601 + ,4.00 + ,2.06069784 + ,-0.045757491 + ,5.00 + ,1.491361694 + ,NA + ,2.00 + ,1.799340549 + ,0.414973348 + ,3.00 + ,1.322219295 + ,0.380211242 + ,1.00 + ,1.716003344 + ,0.079181246 + ,2.00 + ,2.214843848 + ,-0.045757491 + ,2.00 + ,2.352182518 + ,-0.301029996 + ,3.00 + ,2.352182518 + ,NA + ,5.00 + ,2.176091259 + ,-0.22184875 + ,5.00 + ,2.178976947 + ,NA + ,2.00 + ,1.954242509 + ,0.342422681 + ,2.00 + ,NA + ,0.361727836 + ,2.00 + ,1.77815125 + ,-0.301029996 + ,3.00 + ,2.301029996 + ,0.414973348 + ,2.00 + ,1.662757832 + ,-0.22184875 + ,4.00 + ,2.322219295 + ,0.819543936 + ,1.00 + ,1.146128036 + ,NA + ,1.00 + ,1.579783597) + ,dim=c(3 + ,62) + ,dimnames=list(c('log(PS)' + ,'D' + ,'log(Tg)') + ,1:62)) > y <- array(NA,dim=c(3,62),dimnames=list(c('log(PS)','D','log(Tg)'),1:62)) > 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 log(PS) D log(Tg) 1 NA 3 2.809560 2 0.30103000 3 1.623249 3 NA 1 1.778151 4 NA 3 1.397940 5 0.25527250 4 2.795185 6 -0.15490196 4 2.255273 7 0.59106461 1 1.544068 8 0.00000000 4 2.593286 9 0.55630250 1 1.799341 10 0.14612804 1 2.361728 11 0.17609126 4 2.049218 12 -0.15490196 5 2.448706 13 0.43136376 2 NA 14 NA 5 2.562293 15 0.32221930 1 1.623249 16 NA 2 1.447158 17 0.61278386 2 1.623249 18 0.07918125 2 2.079181 19 0.11394335 1 NA 20 0.78532983 1 NA 21 -0.52287874 5 2.602060 22 -0.30103000 5 2.170262 23 0.53147892 2 1.204120 24 NA 1 2.401401 25 0.17609126 1 2.491362 26 NA 1 1.799341 27 0.53147892 3 1.447158 28 -0.09691001 4 1.832509 29 -0.09691001 5 2.526339 30 NA 1 2.000000 31 NA 4 1.518514 32 0.14612804 4 1.332438 33 0.30103000 1 1.698970 34 0.27875360 1 2.426511 35 0.38021124 1 1.477121 36 0.44715803 3 1.653213 37 0.11394335 3 1.278754 38 0.30103000 3 1.477121 39 0.74818803 1 1.079181 40 0.49136169 1 2.079181 41 0.00000000 5 2.643453 42 0.25527250 2 2.146128 43 -0.04575749 4 2.230449 44 0.25527250 2 1.230449 45 0.27875360 4 2.060698 46 -0.04575749 5 1.491362 47 NA 2 1.799341 48 0.41497335 3 1.322219 49 0.38021124 1 1.716003 50 0.07918125 2 2.214844 51 -0.04575749 2 2.352183 52 -0.30103000 3 2.352183 53 NA 5 2.176091 54 -0.22184875 5 2.178977 55 NA 2 1.954243 56 0.34242268 2 NA 57 0.36172784 2 1.778151 58 -0.30103000 3 2.301030 59 0.41497335 2 1.662758 60 -0.22184875 4 2.322219 61 0.81954394 1 1.146128 62 NA 1 1.579784 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) D `log(Tg)` 1.0584 -0.1086 -0.2977 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.348607 -0.142976 0.008145 0.139770 0.463411 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.05844 0.11627 9.103 1.72e-11 *** D -0.10859 0.02070 -5.246 4.77e-06 *** `log(Tg)` -0.29774 0.06348 -4.690 2.89e-05 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.1825 on 42 degrees of freedom (17 observations deleted due to missingness) Multiple R-squared: 0.6588, Adjusted R-squared: 0.6426 F-statistic: 40.55 on 2 and 42 DF, p-value: 1.556e-10 > 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