[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: converting variances to p-values after -nbreg-: use -ttail()- or -normal()-?

From   "Brian Karfunkel" <>
Subject   st: converting variances to p-values after -nbreg-: use -ttail()- or -normal()-?
Date   Wed, 5 Nov 2008 12:43:27 -0800

Hello all,

I have an neg. binomial regression with 4 regressors (plus constant
and ln alpha), and am trying to convert the e(.) matrices to a
matrix/vector of p-values without having to run -test- on each
independent variable and use r(p).

First, is there a way to perform functions (and mathematical
operations) on all of the elements of a matrix without looping through
rows and columns? Right now, I am looping through and have, for

. local t = _b[facility_texas]/_se[facility_texas]
. di `t'
. local df = e(N) - e(k)
. di `df'
. local pvalue = 2*ttail(`df',abs(`t'))
. di `pvalue'
. test facility_texas [output omitted]
. di 2*(1-normal(abs(`t')))

Is there a certain point at which Stata uses a normal dist. (i.e.,
t-dist. with infinite d.f.) when the d.f. gets large, instead of
-ttail-? Am I wrong to think that -ttail- is the correct function? I
know the difference is probably too small to matter, but I'm trying to
make sure that the p-value I generate will exactly match the p-value
in the regression table and that reported by -test-.

Thank you for any help you can provide,

Brian Karfunkel
*   For searches and help try:

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