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

Re: st: stcox output: p-value and CI don't agree

From   Richard Williams <>
Subject   Re: st: stcox output: p-value and CI don't agree
Date   Wed, 08 Aug 2007 02:24:00 -0400

At 12:51 AM 8/8/2007, Michael McCulloch wrote:
Hmmm... That suggests there's a way to alter my code so that could be done! It's only out of my own inexperience (and not out of laziness) that I ask whether anybody might see how to change this bootstrap program to test the hypothesis that the coefficient = 1?
I think the test stat would still be wrong, albeit less wrong than before, because b/se would not have a normal distribution. So, I don't recommend it in this case; use the unexponentiated coefficient instead. But in general, the formula is (Observed coefficient - Value predicted by the null)/ se of coefficient. The z and t values reported by Stata (and perhaps every other program in the world) assume that the null hypothesis is that the coefficient = 0, but there is no reason it couldn't be 1 or some other value. More simply, after running your model you can just give a command like

test drug = 1

Is there a way to extract and the exponentiate the reported coefficient, the lower limit and the upper limit with code, rather than manually?

After running your program, type -ereturn list-. I think you'll find that all the information you need is contained in matrices, e.g. e(b), e(se), e(ci_normal). Then do stuff like

. mat b = e(b)

. scalar bexp = exp(el(b, 1,1))

. display bexp

Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME: (574)289-5227
EMAIL: Richard.A.Williams.5@ND.Edu

* For searches and help try:

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