Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: FW: question concerning meta analyses on prevalences
From
"b. water" <[email protected]>
To
<[email protected]>
Subject
st: FW: question concerning meta analyses on prevalences
Date
Tue, 1 Mar 2011 11:32:23 +0000
Hi,
Barbara Mascialino sent me off list, thought putting the response here might be helpful/useful.
Nicola Orsini (from Karolinska Institute) provided me with this back in 2005. You need to install user written command 'metan' to get this to work. I used (and still do) stata 8.2, should not make a difference if you are using later version (your graphs will look better though).
// suppose you have 4 studies
clear
input study cases total
1 20 1000
2 40 5000
3 30 1500
4 25 3300
end
gen p = .
gen se = .
// get proportions and std errors
forv i =1(1)4 {
cii total[`i'] cases[`i']
qui replace p = r(mean) in `i'
qui replace se = r(se) in `i'
}
// get the inverse variance-weighted proportion
// use the official Stata -vwls- command
gen cons =1
vwls p cons, sd(se)
// use the user written -metan- command
// for fixed-effects meta-analysis
metan p se, nograph fixed
// for random-effects meta-analysis
metan p se, nograph random
hth,
bw
*
* 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/