Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Confidence intervals around ratios/differences of predicted probabilities


From   "Roger B. Newson" <[email protected]>
To   [email protected]
Subject   Re: st: Confidence intervals around ratios/differences of predicted probabilities
Date   Mon, 12 Aug 2013 11:20:42 +0100

The -punaf- suite of packages does this sort of thing, and can be downloaded from SSC. The packages (-punaf-, -punafcc-, -regpar-, -margprev- and -marglmean-) are described in Newson (2012), presented at the UK Stata User Meeting in 2012.

Best wishes

Roger

References

Newson RB. Scenario comparisons: How much good can we do? Presented at the 18th UK Stata User Meeting, 13–14 September, 2012. Download from
http://www.stata.com/meeting/uk12/abstracts/#newson

Roger B Newson BSc MSc DPhil
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton Campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
UNITED KINGDOM
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: [email protected]
Web page: http://www.imperial.ac.uk/nhli/r.newson/
Departmental Web page:
http://www1.imperial.ac.uk/medicine/about/divisions/nhli/respiration/popgenetics/reph/

Opinions expressed are those of the author, not of the institution.

On 12/08/2013 10:52, P.Praeg wrote:
Dear all:

I would like to calculate confidence intervals around ratios and differences of predicted probabilities as obtained from logistic regression models. Is there a straightforward way to calculate these in Stata? Specifically, I am doing the following:

sysuse auto, clear

// I have a logistic regression model with a binary outcome (foreign),
// a set of dummies which denote several groups of interest (i.groups),
// and a vector of controls (not shown here to make things easier):

gen groups = irecode(mpg, 17, 23, 42)  // Creates three groups based on mpg

logistic foreign i.groups

// With the -margins- command, I get predicted probabilities of
// being foreign for each of my groups:

margins i.groups, coeflegend

// What I am interested in then is the difference and the ratio of
// some of these predicted probabilities:

matrix pred_prob = r(table)

   // Difference
di pred_prob[1,3] - pred_prob[1,1]

   // Ratio
di pred_prob[1,3] / pred_prob[1,1]

This now gives me point estimates for the difference and ratio of the predicted probabilities.

My question now is: Is there any straightforward way to obtain confidence intervals around these point estimates?

Thanks for your consideration!
Patrick

--
Patrick Präg
ICS/Department of Sociology
Faculty of Social and Behavioral Sciences
University of Groningen
Grote Rozenstraat 31
9712 TG Groningen, The Netherlands

Tel: +31 (0)50 363 7620
Email: [email protected]

http://www.rug.nl/staff/p.praeg

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index