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]

From |
"Michael.Stuetzer" <[email protected]> |

To |
[email protected] |

Subject |
st: Computing predicted probabilities in multi-level model (xtmelogit) |

Date |
Fri, 22 Oct 2010 10:52:15 +0200 |

Dear Colleagues,

However, I have a couple of questions.

Thanks a lot Michael use... quietly summarize Zopport global opport=r(mean) quietly summarize Zknowent global knowent=r(mean) quietly summarize Zbipwachstum_l1t5 global bipwachstum_l1t5=r(mean)-r(sd) quietly summarize int_ownmge_bipwachstum5 global int_ownmge_bipwachstum=r(mean)

/* get vector of logistic coefficients */ matrix b = e(b) matrix list b /* keep only the elements of b that are of interest */ matrix b = b[1,2..7] matrix list b /* predict random effects */ predict b1, reffects /* create vector of random effects */ quietly tab b1, matrow(b1) matrix list b1 * mata /* bring vectors b and b1 into Mata */ b = st_matrix("b") b1 = st_matrix("b1") /* bring the global macro variables into Mata */ knowent = strtoreal(st_global("knowent")) opport = strtoreal(st_global("opport")) bipwachstum_l1t5= strtoreal(st_global("bipwachstum_l1t5")) bipwachstum_l1t5 int_ownmge_bipwachstum = strtoreal(st_global("int_ownmge_bipwachstum")) end mata /* loop to compute probabilities for knowent and not knowent */ for (ownmge=0; ownmge<=1; ownmge++) {

xb = b*x xbr = xb:+b1 expxbr = exp(xbr) p = expxbr:/(1:+expxbr) mean(p) } end ***** -- Dipl.-Vw. Michael Stützer Thüringer Gründer Studie/ Lehrstuhl für Mikroökonomik Friedrich-Schiller-Universität Jena Carl-Zeiß-Str. 3 D-07743 Jena Tel.: +49 03641 943207 Fax.: +49 03641 943202 * * 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/

- Prev by Date:
**st: Re: estout and test statistics** - Next by Date:
**st: Marginal effects and standard errors after ivprobit twostep** - Previous by thread:
**st: clustering in quantile regressions with sampling weights** - Next by thread:
**Re: st: Computing predicted probabilities in multi-level model (xtmelogit)** - Index(es):