I am doing logistic regression in R. Can somebody clarify what is the differences of running these two lines?
1. glm(Response ~ Temperature, data=temp,
family = binomial(link="logit"))
2. glm(cbind(Response, n - Response) ~ Temperature,
data=temp, family =binomial, Ntrials=n)
The data looks like this: (Note : Response is binary. 0=Die 1=Not die)
Response Temperature
0 24.61
1 39.61
1 39.50
0 22.71
0 21.61
1 39.70
1 36.73
1 33.32
0 21.73
1 49.61
n
is 1 then you should get exactly the same answer in this case. In general you should use the second form when you have more than one trial per observation. TheNtrials
argument is bogus/unnecessary, as far as I can tell.N=1
), reserving "binomial regression" for the grouped case, but the terms are somewhat interchangeable ...