-
Login or Register
- Log in with
gr_edit .plotregion1.column1.bhom_stats[1].text.Arrpush {it:Test of group differences: Q{sub:b}(2) = 1.86, p = 0.39}
******************************************************************************** clear all gr drop _all use https://www.stata-press.com/data/r16/bcgset meta forestplot, subgroup(alloc) eform graph save a_graph_fp, replace gr drop _all ********************************************************************************
******************************************************************************** gr use a_graph_fp ********************************************************************************
******************************************************************************** mata: type = "hom" /* "bhom" */ pat = ".create_" + type + "stats" gph = cat("a_graph_fp.gph") /* read gph to be parsed */ stats = ustrregexrf( select(gph, strpos(gph, pat):> 0), "^.*?\s", "" ) for ( i=1; i<=length(stats); i++ ) { hs = tokens(stats[i])[1::4] hs[3] = sprintf("%5.2f", strtoreal(hs[3])) hs[4] = sprintf("%5.2f", strtoreal(hs[4])) hs = hs[1] + " Q(" + hs[2] + ") = " + hs[3] + ", p = " + hs[4] if ( type=="bhom" ) { hs = subinstr(hs, "Q", "Q{sub:b}", 1) } hs = "{it:" + hs + "}" ed0 = "gr_edit .plotregion1.column1." + type + "_stats[" + strofreal(i) + "].text" ed1 = ed0 + "= {}" ed2 = ed0 + ".Arrpush " + hs stata(ed1) stata(ed2) } end ********************************************************************************
/*
ed2:
* hom
gr_edit .plotregion1.column1.hom_stats[1].text.Arrpush {it:Test of {&theta}{sub:i} = {&theta}{sub:j}: Q(1) = 5.56, p = 0.02}
gr_edit .plotregion1.column1.hom_stats[2].text.Arrpush {it:Test of {&theta}{sub:i} = {&theta}{sub:j}: Q(6) = 110.21, p = 0.00}
gr_edit .plotregion1.column1.hom_stats[3].text.Arrpush {it:Test of {&theta}{sub:i} = {&theta}{sub:j}: Q(3) = 16.59, p = 0.00}
gr_edit .plotregion1.column1.hom_stats[4].text.Arrpush {it:Test of {&theta}{sub:i} = {&theta}{sub:j}: Q(12) = 152.23, p = 0.00}
* bhom
gr_edit .plotregion1.column1.bhom_stats[1].text.Arrpush {it:Test of group differences: Q{sub:b}(2) = 1.86, p = 0.39}
*/
Comment