cap ssc inst parmest
di in red _rc
webuse rod93, clear
tab cohort, gen(coh)
generate logexp=ln(exposure)
nbreg deaths coh2 coh3, exposure(exp)
parmest, saving(myfile, replace)
u myfile, clear
l
HTH
Martin
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Brian Karfunkel
Sent: Wednesday, November 05, 2008 8:16 PM
To: [email protected]
Subject: st: converting variances to p-values after -nbreg-: ttail or
normal?
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
example:
. local t = _b[facility_texas]/_se[facility_texas]
. di `t'
-.31532904
. local df = e(N) - e(k)
. di `df'
2906
. local pvalue = 2*ttail(`df',abs(`t'))
. di `pvalue'
.75253448
. test facility_texas [output omitted]
.75251184
. di 2*(1-normal(abs(`t')))
.75251184
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:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* 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/