From: Andrea Hodgins-Davis on
Hi there,

Is there a straightforward way to do inverse prediction for a simple
logistic regression in MATLAB? I've used "glmfit" with the binomial
distribution to fit my data and now I'd really love a simple command
for getting the X (predictor) value resulting in a 50% probability
value for the response. The "glmval" command with "logit" link
produces Y from a range of X, but not the reverse as far as I can
tell. If this functionality doesn't exist in a pre-packaged form,
that's fine, but simpler stats packages often allow this, so I thought
I'd check.

Thanks for any help you can offer,

Andrea
From: Peter Perkins on
On 7/8/2010 4:49 PM, Andrea Hodgins-Davis wrote:
> Is there a straightforward way to do inverse prediction for a simple
> logistic regression in MATLAB? I've used "glmfit" with the binomial
> distribution to fit my data and now I'd really love a simple command
> for getting the X (predictor) value resulting in a 50% probability
> value for the response.

Andrea, there's no built-in way to do that, but if all you need is the
point estimate, I expect you already surmised that the way to do that
would be

invLogitPredict = @(p,beta) (log(p./(1-p)) - beta(1))/beta(2);
x50 = invLogitPredict(.5,beta);

Hope this helps.
 | 
Pages: 1
Prev: 'ColorOrder' Property
Next: Butterworth filter