Bin Yue
2007-Dec-06 02:06 UTC
[R] logistic regression using "glm",which "y" is set to be "1"
Dear friends : using the "glm" function and setting family=binomial, I got a list of coefficients. The coefficients reflect the effects of predicted variables on the probability of the response to be "1". My response variable consists of "A" and "D" . I don't know which level of the response was set to be 1. is the first element of the response set to be 1? Thank all in advance. Regards, ----- Best regards, Bin Yue ************* student for a Master program in South Botanical Garden , CAS -- View this message in context: http://www.nabble.com/logistic-regression-using-%22glm%22%2Cwhich-%22y%22-is-set-to-be-%221%22-tf4953617.html#a14185060 Sent from the R help mailing list archive at Nabble.com.
Marc Schwartz
2007-Dec-06 02:47 UTC
[R] logistic regression using "glm",which "y" is set to be "1"
On Wed, 2007-12-05 at 18:06 -0800, Bin Yue wrote:> Dear friends : > using the "glm" function and setting family=binomial, I got a list of > coefficients. > The coefficients reflect the effects of predicted variables on the > probability of the response to be "1". > My response variable consists of "A" and "D" . I don't know which level of > the response was set to be 1. > is the first element of the response set to be 1? > Thank all in advance. > Regards, > > ----- > Best regards, > Bin YueAs per the Details section of ?glm: For binomial and quasibinomial families the response can also be specified as a factor (when the first level denotes failure and all others success) ... So use: levels(response.variable) and that will give you the factor levels, where the first level is 0 and the second level is 1. If you work in a typical English based locale with default alpha based level ordering, it will likely be A (Alive?) is 0 and D (Dead?) is 1. HTH, Marc Schwartz
Apparently Analagous Threads
- the observed "log odds" in logistic regression
- paradox about the degree of freedom in a logistic regression model
- how to find the minimum
- glm family=binomial logistic sigmoid curve problem
- Breakpoint in logistic GLM with 'segmented' package - error: replacement length zero