Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

RE: st: calculating PAR when there are >2 categories within a variable


From   "Benjamin, Laura" <L.Benjamin@liverpool.ac.uk>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   RE: st: calculating PAR when there are >2 categories within a variable
Date   Tue, 9 Apr 2013 07:07:56 +0000

Dear Roger,

Very helpful....thank you!

Laura
________________________________________
From: owner-statalist@hsphsun2.harvard.edu [owner-statalist@hsphsun2.harvard.edu] on behalf of Roger B. Newson [r.newson@imperial.ac.uk]
Sent: 08 April 2013 22:17
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: calculating PAR when there are >2 categories within a variable

In this case, I would create 4 dummy variables (as with -xi-), and use
-punaf- after -logit-. As in:

xi i.myfactor
desc _I*
logit myyvar _I*
punaf, at(_Inyfactor_2==0)
punaf, at(_Inyfactor_3==0)
punaf, at(_Inyfactor_4==0)


The -xi- command creates 3 dummy variables. The -logit- command fits the
model. And the 3 -punaf- commands compare the 3 fantasy scenarios with
the real world.

I hope this helps.

Best wishes

Roger

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: r.newson@imperial.ac.uk
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 08/04/2013 22:04, Benjamin, Laura wrote:
> Dear Roger,
>
> Thank you for this quick response.
>
> I want to imagine 3 different fantasy scenarios, where subjects with factor level 2, 3 or 4 are reassigned to factor level 1? Can that work with -punaf-STATA 11?
>
> Thanks,
>
> Laura
>
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Roger B. Newson
> Sent: Monday, April 08, 2013 9:42 PM
> To: statalist@hsphsun2.harvard.edu
> Subject: Re: st: calculating PAR when there are >2 categories within a variable
>
> You really have to specify what we mean by "the PAR for each of the categories". This is because we have to specify 2 scenarios if we use -punaf-. And, in Stata Version 11, one of these 2 scenarios must be the real world, and the other should be a fantasy scenario. (In Stata Version 12, -punaf- can compare 2 fantasy scenarios, specified by the
> -atspec()- and -atzero()- options.)
>
> So, you really have to specify your fantasy scenarios, which you want to compare with the real world. Do you want to imagine 4 different fantasy scenarios, in which everybody has factor level 1, 2, 3 and 4, respectively, and compare these scenarios with the real world? Or do you want to imagine 3 different fantasy scenarios, where subjects with factor level 2, 3 or 4 (respectively) are reassigned to factor level 1?
> Or something completely different?
>
> Best wishes
>
> Roger
>
> 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: r.newson@imperial.ac.uk
> 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 08/04/2013 21:29, Benjamin, Laura wrote:
>> Hi there,
>>
>> I am working with STATA 11 and calculating the population attributable risk (PAR) for several risk factors of stroke; this is based on a case-control design. I have been using the punaf function for this.
>>
>> I am uncertain about how to determine the PAR when there are >2 categories within a variable.
>>
>> For example, the variable "woodexp" has four categories (one of these being the reference). Is it possible to calculate the PAR for each of the categories? I would appreciate any advice on this.
>>
>>
>>
>> Many thanks,
>>
>> Laura
>>
>>
>>
>>
>>
>> *
>> *   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/
>
> *
> *   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/

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index