Statalist


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

st: re: how may I compute standard errors and/or confidenceintervals


From   "Ben Dwamena" <[email protected]>
To   <[email protected]>
Subject   st: re: how may I compute standard errors and/or confidenceintervals
Date   Sun, 09 Dec 2007 23:36:28 -0500

Kit,
Thanks for the elegant  solution to my question.
Ben

>>> Kit Baum <[email protected]> 12/9/2007 7:38 AM >>>
Ben said

I am working  with normally distributed test results in patients with  
and without a disease condition related to alpha (accuracy parameter)  
and beta (threshold parameter) such that:

alpha = (2*pi/sqrt(3))*[ (mu_nd - mu_d)/(sigma_nd + sigma_d)]

beta = (sigma_nd - sigma_d)/(sigma_nd + sigma_d)

where mu_nd and sigma_nd  are the mean and standard deviation of test  
results in N_nd non-diseased patients

and mu_d and sigma_d  are the mean and standard deviation of test  
results in N_d diseased patients.


How may I compute  standard errors and/or confidence intervals for  
alpha and beta?



As Ben has specified that the data are normally distributed, all we  
have to do is get the two means and sd's in a single coefficient  
vector via maximum likelihood:

----- cut here -----
program drop _all
program ben
version 10.0
args lnf mu1 mu2 sigma1 sigma2
qui replace `lnf' = ln(normalden($ML_y1, `mu1', `sigma1')) if  
$disease == 0
qui replace `lnf' = ln(normalden($ML_y1, `mu2', `sigma2')) if  
$disease == 1
end

sysuse auto, clear
global disease foreign
gen iota = 1
ml model lf ben  (mu1: price=iota) (mu2: price=iota) /sigma1 /sigma2
// ml check
ml maximize, nolog
// you can check the results by doing
// ivreg2 price if ~foreign
// ivreg2 price if foreign

// Ben's beta measure
nlcom ([sigma1]_b[_cons] - [sigma2]_b[_cons])/([sigma1]_b[_cons] +  
[sigma2]_b[_cons])

// Ben's alpha measure
nlcom 2*_pi*sqrt(3) * (([mu1]_b[_cons] - [mu2]_b[_cons])/([sigma1]_b 
[_cons] + [sigma2]_b[_cons]))

---- cut here ----

In this case the 'model' is nothing more than regression on a  
constant, allowing mu and sigma to differ across the two classes. You  
will get the same mu and sigma if you run that regression (use ivreg2  
to get z-stats rather than t-stats, with the sigma divided by n, and  
it agrees with ml).

-nlcom- then cranks out the desired point and interval estimates via  
the delta method.


Kit Baum, Boston College Economics and DIW Berlin
http://ideas.repec.org/e/pba1.html 
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html 


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html 
*   http://www.stata.com/support/statalist/faq 
*   http://www.ats.ucla.edu/stat/stata/

**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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