Skip to content
Prev 75811 / 398502 Next

do glm with two data sets

Hu, Ying (NIH/NCI) wrote:
Hi, Ying,

What's wrong with this solution? Do you still get an error? What is your 
primary goal?

A couple of points:

1. It's better to use names in your data.frame:

d1 <- data.frame(g = g[1,], e = e[1,])

Then in glm:

fit <- glm(e ~ g, data = d1)

2. Also, you may just be giving us a toy example, but if you don't 
specify a family argument in glm then you are simply getting the least 
squares. In that case you should use ?lm instead.

HTH,

--sundar