It seems (at least) one of the studies has plenty of characters.
Please read the FAQ. There you'l find how to share data\command\output\graphs.
Please read the FAQ. There you'l find how to share data\command\output\graphs.
gen double lHR=ln(HR) gen double ln_lci=ln(lci) gen double ln_uci=ln(uci) metan lHR ln_lci ln_uci, by(Level) eform effect(HR) xlabel(0.5, 5.5) force nooverall stats nosubgroup nobox nowt label(namevar=Condition) xtitle("Hazard ratio (95% CI)", size(small)) title("Diseases ", size(small))
gen double lHR=ln(HR) gen double ln_lci=ln(lci) gen double ln_uci=ln(uci) metan lHR ln_lci ln_uci, by(Level) eform effect(HR) xlabel(0.5, 5.5) force nooverall stats nosubgroup nobox nowt label(namevar=Condition) xtitle("Hazard ratio (95% CI)", size(small)) title("Diseases ", size(small))
* Example generated by -dataex-. To install: ssc install dataex clear input str4 study byte(predno group) str21 predictor double(lnor lnlci lnuci) str6 pvalue double(or lci uci) str19 _EFFECT double(_ES _seES _LCI _UCI _WT) byte _rsample "dc" 1 1 "Stab" 0 0 0 "" 1 0 0 "(Insufficient data)" 0 . 0 0 . 0 "dc" 2 1 "Gun" .7275486072772777 .5007752879124892 .9555114450274363 "<0.001" 2.07 1.65 2.6 "2.07 (1.65, 2.60)" .7275486072772777 .11600625335512492 .5007752879124892 .9555114450274363 23.997450481003785 1 "dc" 3 2 "Commercial" 0 0 0 "" 1 0 0 "(Insufficient data)" 0 . 0 0 . 0 "dc" 4 2 "Medicaid" -.12783337150988489 -.40047756659712525 .13976194237515863 ".347" .88 .67 1.15 "0.88 (0.67, 1.15)" -.12783337150988489 .13781873372001333 -.40047756659712525 .13976194237515863 17.00244563514373 1 "dc" 5 2 "Other Government" -.4155154439616658 -1.0498221244986778 .22314355131420976 ".206" .66 .35 1.25 "0.66 (0.35, 1.25)" -.4155154439616658 .32474210900146094 -1.0498221244986778 .22314355131420976 3.062320853623977 1 "dc" 6 2 "Self Pay" -.4620354595965587 -.8675005677047231 -.05129329438755058 ".029" .63 .42 .95 "0.63 (0.42, 0.95)" -.4620354595965587 .20821996724310027 -.8675005677047231 -.05129329438755058 7.448745873293347 1 "dc" 7 2 "Other/Unknown" .1906203596086497 -.13926206733350766 .5247285289349821 ".266" 1.21 .87 1.69 "1.21 (0.87, 1.69)" .1906203596086497 .16938846874380423 -.13926206733350766 .5247285289349821 11.255381536342462 1 "dc" 8 3 "Stab#Commercial" 0 0 0 "" 1 0 0 "(Insufficient data)" 0 . 0 0 . 0 "dc" 9 3 "Gun#Commercial" .9202827531436925 .4824261492442928 1.358409157630355 "<0.001" 2.51 1.62 3.89 "2.51 (1.62, 3.89)" .9202827531436925 .22346915945795554 .4824261492442928 1.358409157630355 6.466848913226217 1 "dc" 10 3 "Stab#Medicaid" .12221763272424911 -.3285040669720361 .5709795465857378 ".609" 1.13 .72 1.77 "1.13 (0.72, 1.77)" .12221763272424911 .22946432196019576 -.3285040669720361 .5709795465857378 6.13334743682981 1 "dc" 11 3 "Gun#Medicaid" .6259384308664954 .19885085874516517 1.0508216248317612 ".003" 1.87 1.22 2.86 "1.87 (1.22, 2.86)" .6259384308664954 .217343474881894 .19885085874516517 1.0508216248317612 6.836513770643987 1 "dc" 12 3 "Stab#Other Government" -.5108256237659907 -1.7147984280919266 .712949807856125 ".411" .6 .18 2.04 "0.60 (0.18, 2.04)" -.5108256237659907 .6193349100028931 -1.7147984280919266 .712949807856125 .841931550161769 1 "dc" 13 3 "Gun#Other Government" .5068176023684519 -.3011050927839216 1.3217558399823195 ".223" 1.66 .74 3.75 "1.66 (0.74, 3.75)" .5068176023684519 .41400274330731623 -.3011050927839216 1.3217558399823195 1.8841760003246908 1 "dc" 14 3 "Stab#Self Pay" -.342490308946776 -1.0788096613719298 .3920420877760237 ".358" .71 .34 1.48 "0.71 (0.34, 1.48)" -.342490308946776 .37522417777822575 -1.0788096613719298 .3920420877760237 2.2937510279992077 1 "dc" 15 3 "Gun#Self Pay" .34358970439007686 -.2231435513142097 .9162907318741551 ".235" 1.41 .8 2.5 "1.41 (0.80, 2.50)" .34358970439007686 .2906773522820004 -.2231435513142097 .9162907318741551 3.822130526192121 1 "dc" 16 3 "Stab#Other/Unknown" .131028262406404 -.4462871026284195 .7080357930536959 ".663" 1.14 .64 2.03 "1.14 (0.64, 2.03)" .131028262406404 .2944755375066245 -.4462871026284195 .7080357930536959 3.724169672323977 1 "dc" 17 3 "Gun#Other/Unknown" 1.1908875647772805 .7030975114131134 1.6770965609079151 "<0.001" 3.29 2.02 5.35 "3.29 (2.02, 5.35)" 1.1908875647772805 .24847371104203503 .7030975114131134 1.6770965609079151 5.230786722890927 1 "dead" 18 4 "Stab" 0 0 0 "" 1 0 0 "" . . . . . 0 "dead" 19 4 "Gun" .6151856390902335 .29266961396282004 .9360933591703348 "<0.001" 1.85 1.34 2.55 "" . . . . . 0 "dead" 20 5 "Commercial" 0 0 0 "" 1 0 0 "" . . . . . 0 "dead" 21 5 "Medicaid" .22314355131420976 -.2231435513142097 .6729444732424258 ".319" 1.25 .8 1.96 "" . . . . . 0 "dead" 22 5 "Other Government" .08617769624105241 -.7339691750802004 .9122827104766164 ".841" 1.09 .48 2.49 "" . . . . . 0 "dead" 23 5 "Self Pay" .8796267475025636 .1570037488096647 1.3787660946990992 ".001" 2.41 1.17 3.97 "" . . . . . 0 "dead" 24 5 "Other/Unknown" .6097655716208943 .10436001532424286 1.1249295969854831 ".019" 1.84 1.11 3.08 "" . . . . . 0 "dead" 25 6 "Stab#Commercial" 0 0 0 "" 1 0 0 "" . . . . . 0 "dead" 26 6 "Gun#Commercial" .6575200029167941 -.09431067947124129 1.410986973710262 ".088" 1.93 .91 4.1 "" . . . . . 0 "dead" 27 6 "Stab#Medicaid" .44468582126144574 -.2484613592984996 1.1346227261911428 ".208" 1.56 .78 3.11 "" . . . . . 0 "dead" 28 6 "Gun#Medicaid" .7371640659767196 .03922071315328133 1.430311246536665 ".037" 2.09 1.04 4.18 "" . . . . . 0 "dead" 29 6 "Stab#Other Government" .12221763272424911 -1.1394342831883648 1.3635373739972745 ".852" 1.13 .32 3.91 "" . . . . . 0 "dead" 30 6 "Gun#Other Government" .7466879474879751 -.4307829160924542 1.918392120161421 ".211" 2.11 .65 6.81 "" . . . . . 0 "dead" 31 6 "Stab#Self Pay" .688134638736401 -.11653381625595151 1.4973884086254774 ".096" 1.99 .89 4.47 "" . . . . . 0 "dead" 32 6 "Gun#Self Pay" 1.6582280766035324 .9162907318741551 2.3997118037247684 "<0.001" 5.25 2.5 11.02 "" . . . . . 0 "dead" 33 6 "Stab#Other/Unknown" .5128236264286637 -.31471074483970024 1.33500106673234 ".226" 1.67 .73 3.8 "" . . . . . 0 "dead" 34 6 "Gun#Other/Unknown" 1.3270750014599193 .5709795465857378 2.0844290831908747 ".001" 3.77 1.77 8.04 "" . . . . . 0 end
. label variable predictor "Predictor" . label variable pvalue "P value" . admetan lnor lnlci lnuci if study=="dc", study(predictor) sortby(predno) /// by(group) eform effect(Odds Ratio) /// rcols(pvalue) nooverall nosubgroup keepall keeporder /// nograph saving(nygaard) . use nygaard, clear . replace _EFFECT = "Reference" if _USE==2 . replace _USE=1 if _USE==2 . format _EFFECT %-17s . forestplot, useopts xlabel(0.1 0.2 0.5 1 2 5 10) nostats nowt rcols(_EFFECT pvalue)
use http://fmwww.bc.edu/repec/bocode/m/metan_example_data, clear metan tdeath tnodeath cdeath cnodeath, rr fixed counts label(namevar=id) xlab(.1 .5 1 2 4 10 20 50) by(type_study)
Comment