I have a model fitted (from the literature). I also have the raw data for the predictive variables.
What's the equation I should be using to get probabilities? Basically, how do I combine raw data and coefficients to get probabilities?
|
I have a model fitted (from the literature). I also have the raw data for the predictive variables. What's the equation I should be using to get probabilities? Basically, how do I combine raw data and coefficients to get probabilities? |
||||
|
|
|
Here is the applied researcher's answer (using the statistics package R). First, let's create some data, i.e. I am simulating data for a simple bivariate logistic regression model $log(\frac{p}{1-p})=\beta_0 + \beta_1 \cdot x$:
The predictor
Second, estimate the intercept ($\beta_0$) and the slope ($\beta_1$). As you can see, the intercept is $\beta_0 = -0.8690$ and the slope is $\beta_1 = -1.0769 $.
Third, R, like most statistical packages, can compute the fitted values, i.e. the probabilities. I will use these values as reference.
Fourth, this step directly refers to your question: We have the raw data (here: $x$) and we have the coefficients ($\beta_0$ and $\beta_1$). Now, let's compute the logits and save these fitted values in
The final step is a comparison of the fitted values based on R's
|
|||||||||||
|
|
The link function of a logistic model is $f: x \mapsto \log \tfrac{x}{1 - x}$. Its inverse is $g: x \mapsto \tfrac{\exp x}{1 + \exp x}$. In a logistic model, the left-hand side is the logit of $\pi$, the probability of success: $f(\pi) = \beta_0 + x_1 \beta_1 + x_2 \beta_2 + \ldots$ Therefore, if you want $\pi$ you need to evaluate $g$ at the right-hand side: $\pi = g( \beta_0 + x_1 \beta_1 + x_2 \beta_2 + \ldots)$. |
|||||||||
|