R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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('T',0,'T',0,'T',1,'T',0,'T',0,'T',0,'T',0,'T',1,'T',1,'T',0,'T',0,'T',1,'T',1,'T',1,'T',0,'T',0,'T',0,'T',0,'T',1,'T',0,'T',0,'T',0,'T',0,'T',-1,'T',0,'T',-1,'T',0,'T',0,'T',0,'T',0,'T',-1,'T',0,'T',0,'T',0,'T',0,'T',0,'T',0,'E',1,'E',1,'E',0,'E',0,'E',0,'E',0,'E',0,'E',0,'E',1,'E',1,'E',0,'E',0,'E',0,'E',1,'E',0,'E',1,'E',0,'E',1,'E',1,'E',1,'E',1,'E',0,'E',0,'E',1,'E',0,'E',0,'E',-1,'E',0,'E',1,'E',1,'E',0,'E',0,'E',0,'S',1,'S',1,'S',1,'S',1,'S',0,'S',-1,'S',0,'S',0,'S',-1,'S',0,'S',0,'S',0,'S',0,'S',-1,'S',0,'S',0,'S',-1,'S',0,'S',0,'S',0,'S',0,'S',0,'S',0,'S',1,'S',0,'S',0,'S',0,'S',0,'S',0,'S',0,'S',0,'S',0,'S',0,'S',0,'S',1),dim=c(2,105),dimnames=list(c('treatment','post1-pre '),1:105)) > y <- array(NA,dim=c(2,105),dimnames=list(c('treatment','post1-pre '),1:105)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } There were 50 or more warnings (use warnings() to see the first 50) > 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.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, 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 treatment post1-pre\r 1 NA 0 2 NA 0 3 NA 1 4 NA 0 5 NA 0 6 NA 0 7 NA 0 8 NA 1 9 NA 1 10 NA 0 11 NA 0 12 NA 1 13 NA 1 14 NA 1 15 NA 0 16 NA 0 17 NA 0 18 NA 0 19 NA 1 20 NA 0 21 NA 0 22 NA 0 23 NA 0 24 NA -1 25 NA 0 26 NA -1 27 NA 0 28 NA 0 29 NA 0 30 NA 0 31 NA -1 32 NA 0 33 NA 0 34 NA 0 35 NA 0 36 NA 0 37 NA 0 38 NA 1 39 NA 1 40 NA 0 41 NA 0 42 NA 0 43 NA 0 44 NA 0 45 NA 0 46 NA 1 47 NA 1 48 NA 0 49 NA 0 50 NA 0 51 NA 1 52 NA 0 53 NA 1 54 NA 0 55 NA 1 56 NA 1 57 NA 1 58 NA 1 59 NA 0 60 NA 0 61 NA 1 62 NA 0 63 NA 0 64 NA -1 65 NA 0 66 NA 1 67 NA 1 68 NA 0 69 NA 0 70 NA 0 71 NA 1 72 NA 1 73 NA 1 74 NA 1 75 NA 0 76 NA -1 77 NA 0 78 NA 0 79 NA -1 80 NA 0 81 NA 0 82 NA 0 83 NA 0 84 NA -1 85 NA 0 86 NA 0 87 NA -1 88 NA 0 89 NA 0 90 NA 0 91 NA 0 92 NA 0 93 NA 0 94 NA 1 95 NA 0 96 NA 0 97 NA 0 98 NA 0 99 NA 0 100 NA 0 101 NA 0 102 NA 0 103 NA 0 104 NA 0 105 NA 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 0 (non-NA) cases Calls: lm -> lm.fit Execution halted