-2
I have a data set to do a logistic regression for the dependent variable "parturition" which is binary qualitative.
With the command below I get the univariate logistic model:
GLM.1 <- glm(parto ~ serie, family=binomial(logit), data=Dataset)
With this other command below I get the p value of the chi-square of the likelihood ratio test.
1-pchisq(GLM.1$null.deviance-GLM.1$deviance, GLM.1$df.null-GLM.1$df.residual)
Which commands should I use to find each of the following components separately?
- deviance
- L(reduced model)
- L(saturated model)
For that you need a data set and a probability distribution. Please clarify the question. (And by the way, what kind of test? A verisimilitude ratio test?)
– Rui Barradas
My data set contains a sample of over 400 individuals. I need to make a logistic regression for the dependent variable "childbirth" which is binary qualitative. I have some independent variables that are also qualitative, with two or more categories. So I need to do the likelihood ratio test.
– Kaluce
Ask a more complete question, with snippets of code you’re using and even make the data (or a sample of it) available, if possible. In stackoverflow, it is always recommended to share a minimum reproducible code -- short and vague questions like this end up being penalized. But trying to contribute substantively, I recommend you take a look at this answer here: https://stats.stackexchange.com/questions/6505/likelihood-ratio-test-in-r
– RogerioJB
Thanks Rui Barradas and Rogeriojb. I improved the questions. I hope you can help me!!
– Kaluce
Thank you Rui Barradas and Rogeriojb. I was able to solve the problem with the lmtest package using the lrtest(GLM.1) function on the link sent by Rogeriojb.
– Kaluce