Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: R: conditional probability

From   "Carlo Lazzaro" <>
To   <>
Subject   st: R: conditional probability
Date   Tue, 19 Jul 2011 12:18:59 +0200

Nico wrote: 
"and prob(B|H) is the jointly probability to hiring a black worker
conditional on being a H worker"

		High skilled  Low skilled	Total
Black			20         40		60

Others		30         50           80
Total			50		90		140

P(B|H)=probability of hiring a black worker conditional on being high
skilled [by the way, this is a conditional probability, not a joint one].


Using data from the table above:



20= high skilled black workers;
140= total observations;
50=total skilled workers.

Put in other words, 0.4 can be read as the probability of sampling a black
skilled worker from a sample of skilled workers (i.e.: 20/50=0.4).

Beware of not reversing the condition: P(B|H) is conceptually different from
P(H|B), even though the resulting probabilities may look not so different.

In Stata, you can type something like this:

gen P(B|H)=[(20/140)/(50/140)].

Obviously, you may want to replace the number between brackets with var

HTH and Kind Regards,
-----Messaggio originale-----
[] Per conto di
Inviato: martedì 19 luglio 2011 0.41
Oggetto: st: conditional probability

Dear Statalist,
I don't know in stata how can estimate this kind of probabilities

probHB=prob(B|H)prob(H)/prob(B|H) prob(H) + prob(W|L) prob(L)

where probHB is the probability to hire a High skill worker in the
market for black worker
and prob(B|H) is the jointly probability to hiring a black worker
conditional on being a H worker.

thanks in advance for your help
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index