| |
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: How does -mcc- compute the CI for the difference in proportions?
From |
Steven Samuels <[email protected]> |
To |
[email protected] |
Subject |
Re: st: How does -mcc- compute the CI for the difference in proportions? |
Date |
Wed, 18 Apr 2007 11:24:49 -0400 |
The formula should obviously be:
Var (pc -pd) = [Var(pc) + Var(pd) -2 Cov(pc,pd)]
= [Pc (1 - Pc) + Pd (1 - Pd) + 2 Pc Pd]/n
The numbers are still okay.
Steve
On Apr 18, 2007, at 11:11 AM, Steven Samuels wrote:
Here are some paired data:
| test_2
test_1 | 0 1 | Total
-----------+----------------------+----------
0 | 1 2 | 3
| 10.00 20.00 | 30.00
-----------+----------------------+----------
1 | 3 4 | 7
| 30.00 40.00 | 70.00
-----------+----------------------+----------
Total | 4 6 | 10
| 40.00 60.00 | 100.00
mcc test_1 test_2 gives:
Proportion with factor
Cases .7
Controls .6 [95% Conf. Interval]
--------- --------------------
difference .1 -.4338565 .6338565
The CI is symmetric. We can recover the the standard error for the
difference as the CI length divided by 2 x 1.96. This gives SE = .
27237578
Let the population values of the proportions in the table be Pa,
Pb, Pc, Pd, with sample values pa=.1, ,pb=.2, pc=.3, pd=.4. The
theory for a multinomial distribution gives:
n x Var(pc -pd) = Var(pc) + Var(pd) -2 Cov(pc,pd)
= Pc (1 - Pc) + Pd (1 - Pd) + 2 Pc Pd
With this formula, the sample standard error for pc-pd would be .
2213594 and the 95% CI [-.3338645 .5338645]. Why the difference?
Steve
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/