# Estimate a Logistic Regression Model

#### Oberon

##### New Member
Hi guys,

I want to estimate a logistic regression model's equation based on observed data and get the coefficients to extrapolate further. I have two inputs (one interval and one ratio) and one output (between 0~1 probability).

Interval Ratio Odds
5 0 0.00%
10 1 0.00%
15 2 0.00%
20 3 0.00%
25 4 0.00%
30 5 0.06%
35 6 0.49%
40 7 3.75%
45 8 23.42%
50 9 70.60%
55 10 94.96%

Is this possible? If so, how would I go about doing this? If someone even has reference materials that I can read that would be great!

#### hlsmith

##### Less is more. Stay pure. Stay poor.
I think you need to better describe your questions. So you have data and you what to treat odds as the dependent variable and acquire coefficients for the one interval and ratio variables.

As you know the dependent variable in logistic regression is binary. If you want to do what I described about your can dichotomize your dependent variable or another about would be to not use logistic regression.

#### Oberon

##### New Member
I think you need to better describe your questions. So you have data and you what to treat odds as the dependent variable and acquire coefficients for the one interval and ratio variables.

As you know the dependent variable in logistic regression is binary. If you want to do what I described about your can dichotomize your dependent variable or another about would be to not use logistic regression.
Thanks for the advice. Right now these two dependent variables are put into a unknown statistical model that outputs a probability of an event happening (the "Odds" dependent variable). Using these data points as clues, I hope to recreate an estimate of that model based on some method or advice given here. I suspect the model is logit but I'm not sure.

#### Dason

Is it the probability or the odds? Contrary to popular belief they are not the same thing.

#### Oberon

##### New Member
Is it the probability or the odds? Contrary to popular belief they are not the same thing.
Ah, it's defined as the chance of the event happening, so probability.

#### Dason

Logistic regression usually implies a binary/binomial response and since you don't include sample sizes I thought fitting a non-linear regression with a logistic function as the response might be appropriate. The fit is pretty darn good but then again there aren't that many points that matter too much but a logistic function seems reasonable for what you've provided.

$$y = \frac{100}{1 + \exp(-0.4121(x - 47.8746))}$$

where y is the probability and x is the corresponding "interval" input.

#### Oberon

##### New Member
Logistic regression usually implies a binary/binomial response and since you don't include sample sizes I thought fitting a non-linear regression with a logistic function as the response might be appropriate. The fit is pretty darn good but then again there aren't that many points that matter too much but a logistic function seems reasonable for what you've provided.

$$y = \frac{100}{1 + \exp(-0.4121(x - 47.8746))}$$

where y is the probability and x is the corresponding "interval" input.
Wow! What kind of sorcery is this?

A few questions:
1) How did you know to use a non-linear regression with logistic function as a response would be a good fit? Was it from examining the graph? I don't know the sample size.
2) Did you manually figure out the constants using two points on the graph or did you plug in all the data points somewhere that derived the equation for you? I found similar constants using the logistic function for interval 40 to 3.75% and interval 45 to 23.42%. I suppose I need three data points to get constants for the interval AND ratio variables for each probability in the form B0 + B1X1 + B2X2... This will be more tedious to derive manually than with one input though.