Logistic regression for single dependent variable

I am running logistic regression, my dependent variable is binomial (HeardTB "Yes", "No"), but i got only one response ("Yes"). I want to run logistics regression with independent variables, (Age, Sex, Education, Experience, Occupation. P values are not promising and Odd Ratio gives an error. See the attached.

hailogits <- glm(HeardTB ~ Sex + Age + Marital + Education + Occupation + Experience, data = Rhelp, family = "binomial")
summary(hailogits)

exp(cbind(OR = coef(hailogits), confint(hailogits)))


you can not fit any meaningful model where there is no variation in the dependent variable.
There is no signal to detect, there is no information here.

Here is a perfect model that can predict HeardTB....
predict that HeardTB is Yes.

What is that model ?

To always predict yes, without flexibility..

Can you write that model please

function(...) return("YES")

3 Likes

How do I write that function in my model?

You don't.
It would serve no purpose to do so.

Did you collect this data, or where you given it ?
If you are collecting data for a scientific study, I think you need to rethink how you've gone about that, as you will require observations of HeardTB (your subject of interest) to sometimes be "No".
Otherwise you simply aren't studying anything.

1 Like

Thank you so much for your contributions and clearing my doubts

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.