[英]Logistic regression - cbind command in glm
I am doing logistic regression in R. Can somebody clarify what is the differences of running these two lines? 我正在做R中的逻辑回归。有人可以澄清运行这两行的区别是什么?
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) 数据如下所示:(注意:响应是二进制.0 =死1 =不死)
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
When doing the binomial or quasibinomial glm
, you either supply a probability of success, a two-column matrix with the columns giving the numbers of successes and failures or a factor where the first level denotes failure and the others success on the left hand side of the equation. 当做二项式或准二项式
glm
,你要么提供成功的概率,要么提供两列矩阵,列给出成功和失败的数量,或者第一个等级表示失败的因素,另一个成功的左边是等式。 See details in ?glm
. 请参阅
?glm
详细信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.