Hi,

I am trying to test whether a factor (coded as a set of dummy
variables) is equal to zero, using linearHypothesis. I get an error.
See a reproducible example:

data(swiss)
my_swiss = swiss
my_swiss$fake = factor(sample(c("A","B"),47,rep=T))
my_lm <- lm(Infant.Mortality ~ Fertility + fake, data=my_swiss)

> linearHypothesis(my_lm, "fake")
Error in constants(lhs, cnames_symb) :
  The hypothesis "fake" is not well formed: contains bad
coefficient/variable names.
In addition: Warning message:
In constants(lhs, cnames_symb) : NAs introduced by coercion
>

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to