Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Carlo Lazzaro" <carlo.lazzaro@tin.it> |
To | <statalist@hsphsun2.harvard.edu> |
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]. P(B|H)=P(B,H)/P(H) Using data from the table above: P(B|H)=[(20/140)/(50/140)]=0.4 Where: 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 names. HTH and Kind Regards, Carlo -----Messaggio originale----- Da: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Per conto di nicostat@gmail.com Inviato: martedì 19 luglio 2011 0.41 A: statalist@hsphsun2.harvard.edu 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 Nico * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/