<p>If I understood you correctly, $\Lambda(x_i'\hat\beta)$, where $\Lambda(x) = e^x / (1+e^x)$. You can use <code>predict</code> in both R and Stata. Try in Stata:</p>

<pre><code>clear all
*** Generate data
set obs 10
set seed 1
gen x = rnormal()
gen y = 1+x+rnormal() &gt; 0
replace y = . in 7/10
list
*** Estimate
logit y x
*** Predict
predict phat, p
list
</code></pre>

<p>For clarification, I presumed that your outcome variable is in $\{0,1 \}$ (not in $[0,1]$). You observe $y_i$ for some $i$ but not for all, you fitted a logit regression, and then you want to predict the probability for every $i$. Please let me know if I misinterpreted your question.</p>

CC BY-SA 3.0
2017-01-17T22:07:31.203Z
2017-01-17T22:15:50.040Z
2017-01-17T22:15:50.040Z
chan1142
<p>Usually when fitting a logit or probit model to data, one has a dependent binary outcome variable (say, university attendance = [0, 1]) and the usual set of independent variables (for the sake of it, say, parent income, gender and some measure of ability). </p>

<p>In my case, things are a bit different. To stay within the example, for my main data set I do not know whether people attended university. The only aspects I have information about are parent income, gender and other independent variables. However, I was able to obtain data on university attendance for a random subset of the data. Using this subset I fitted a logistic model, obtaining coefficients for all independent variables.</p>

<p>How can I use these coefficients to predict the probability of university attendance for everyone else?</p>

<p>[Please note that the education example is only made to simplify things.]</p>

CC BY-SA 3.0
2017-01-16T20:08:35.847Z
i don't believe that you can say somethng like "given that your family income is a, the probability to attend at university is b". I believe coeeficients can be interpreted as "given the income a, the probability a student attend at a university is b times higher/lower than someone else with an income c"
Yorgos
CC BY-SA 3.0
2017-01-16T20:11:45.973Z
I think that there is a group here (cross validated) where there are myuch more xperienced members who can help you with statistical inference
Yorgos
CC BY-SA 3.0
2017-01-16T21:23:25.560Z
@Yorgos: if it is a logistic model then it is multiplying the *odds* rather than the *probability*.  But given the data and a decent model you can make predictions about the odds and thus the probabilities for other individuals for whom you have the independent data though not the outcome
Henry
CC BY-SA 3.0
2017-02-17T02:02:14.813Z
What do you mean exactly by: "I was able to obtain data on university attendance for a random subset of the data." - do you have specific attendance data for individuals, or not? How do you know that the subset is "random", and what do you mean by "random" in this case?
410 gone
<econometrics><micro-data>
Using a Logit model to predict unknown outcome
eigenvector
# Using a Logit model to predict unknown outcome

(Asked by: username_0 on 2017-01-16)

Usually when fitting a logit or probit model to data, one has a dependent binary outcome variable (say, university attendance = [0, 1]) and the usual set of independent variables (for the sake of it, say, parent income, gender and some measure of ability).

In my case, things are a bit different. To stay within the example, for my main data set I do not know whether people attended university. The only aspects I have information about are parent income, gender and other independent variables. However, I was able to obtain data on university attendance for a random subset of the data. Using this subset I fitted a logistic model, obtaining coefficients for all independent variables.

How can I use these coefficients to predict the probability of university attendance for everyone else?

[Please note that the education example is only made to simplify things.]

**Tags:** econometrics, micro-data
> **Comments:**
> **username_1**: i don't believe that you can say somethng like "given that your family income is a, the probability to attend at university is b". I believe coeeficients can be interpreted as "given the income a, the probability a student attend at a university is b times higher/lower than someone else with an income c"  
> **username_1**: I think that there is a group here (cross validated) where there are myuch more xperienced members who can help you with statistical inference  
> **username_2**: @Yorgos: if it is a logistic model then it is multiplying the *odds* rather than the *probability*.  But given the data and a decent model you can make predictions about the odds and thus the probabilities for other individuals for whom you have the independent data though not the outcome  
> **username_3**: What do you mean exactly by: "I was able to obtain data on university attendance for a random subset of the data." - do you have specific attendance data for individuals, or not? How do you know that the subset is "random", and what do you mean by "random" in this case?  

---

## 1 answers

### Answer by username_4 on 2017-01-17. Score: 3 | Accepted answer

If I understood you correctly, $\Lambda(x_i'\hat\beta)$, where $\Lambda(x) = e^x / (1+e^x)$. You can use predict in both R and Stata. Try in Stata:
clear all
*** Generate data
set obs 10
set seed 1
gen x = rnormal()
gen y = 1+x+rnormal() > 0
replace y = . in 7/10
list
*** Estimate
logit y x
*** Predict
predict phat, p
list

For clarification, I presumed that your outcome variable is in $\{0,1 \}$ (not in $[0,1]$). You observe $y_i$ for some $i$ but not for all, you fitted a logit regression, and then you want to predict the probability for every $i$. Please let me know if I misinterpreted your question.


---

