[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: estout and likelihood ratio test

From   Raoul C Reulen <>
To   <>
Subject   st: estout and likelihood ratio test
Date   Thu, 25 Oct 2007 15:00:20 +0100

Dear Statalisters,
I'm running a glm model and like to do a a likelihood ratio test. However, the likelihood ratio test is based
on a slightly different model. I have difficulty getting the likelihood ratio estimates in a table that I created
with estout. See output below

//first I ran the regression model

.xi: glm _d i.CE , fam(pois) lnoffset(E) eform
// Then I used estout to save the regression estimates, confidence intervals, and p-values in a table

.est store model1
.estout model1, cells("b (fmt(%9.2f))ci(par( ( , ) )) p(fmt(%9.4f))") eform
//Then I did a likelihood ratio test on a slightly different model:
.xi: glm _d CE , fam(pois) lnoffset(E) eform
.est store model2
.xi: glm _d if CE!=. , fam(pois) lnoffset(E) eform
.est store model3
.lrtest  model2 model3
//I saved the p-value for the likelihood ratio test:

.estadd scalar p_trend = r(p)
Is there a way to append the stored value to the estout output based on model 1?
I have tried the following
.estout model1 model2, cells("b (fmt(%9.2f))ci(par( ( , ) )) p(fmt(%9.4f))") eform stats(p_trend)
but this puts the p_trend value in a seperate column, which is not suprising because it is actually part of model 2.

I have also tried to save the estimates of the first model and then append the p_trend value for the second model, but I think estout cannot just append the p_trend because it will need to store at least some of the estimates of the second model. See below:
.estout model1, cells("b (fmt(%9.2f))ci(par( ( , ) )) p(fmt(%9.4f))") eform stats(p_trend)
.estout model2, cells("b (fmt(%9.2f))ci(par( ( , ) )) p(fmt(%9.4f))") stats(p_trend) append
Hope it's clear
Raoul Reulen
Cancer Research UK Graduate Training Fellow

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index