0

How can I find what value of the independent variable is needed to achieve a certain probability in logistic regression? for example, assume we have the following model where X1 is binary (0,1) and X2 is continuous.

m<-glm(Y~ X1+X2 , data=data, family="binomial")

how to find X2 value, at each level of X1, that is associated with Probability (P) =51% for example? I am using R language!

In this link, it provides an answer when there is only 1 predictor ( continuous). I am asking when there are multiple predictors ( some are continuous and some are categorical). Thank you

Thank you!

Malek Ik
  • 101
  • 11
  • Hi @MrFlick. the link you gave solves where there is only 1 predictor. I am looking for when there are multiple predictors. is there a function or package that can help? – Malek Ik Apr 11 '20 at 03:33
  • If you want to fix a level of a predictor just add that to the predict function in the given solution. If you have any more than one continuous predictor you will no longer have a unique solution. Just asking for package recommendations is considered off topic. Focus on solving a specific problem. If you cannot adapt the existing solution to your problem, open a new question that shows your attempt and clearly describes where you get stuck. – MrFlick Apr 11 '20 at 03:39
  • Logistic regression output is constant on planes given by w . x = constant where w is the parameter vector and x is the input vector (e.g., x = (X1, X2) in your example). So any point on one of those planes gives the same output. You could pick a single point by looking for the minimum norm on that plane, or some other criterion. – Robert Dodier Apr 14 '20 at 18:55

0 Answers0