[R] bug in dummy.coef?

David Winsemius dwinsemius at comcast.net
Fri Oct 25 00:57:36 CEST 2013


On Oct 24, 2013, at 1:51 AM, Alexandra Kuznetsova wrote:

> Dear all,
> 
> Running the following code produces an error in dummy.coef. I guess it might be a bug..
> 
>> ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
>> trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
>> group <- gl(2, 10, 20, labels = c("Ctl","Trt"))
>> weight <- c(ctl, trt)
>> x <- rnorm(length(weight))
>> lm.D9 <- lm(weight ~ group + x + I(x^2))
>> dummy.coef(lm.D9)
> Error in rep.int(xl[[i]][1L], nl) : invalid 'times' value

As Rolf Turner pointed out the help page says there are limitations to that function and its only desiged for specific purposes. What are you trying to accomplish?

-- 

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list