Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: adjusted percentages and adjusted odds ratios


From   [email protected]
To   [email protected], [email protected], [email protected]
Subject   st: RE: adjusted percentages and adjusted odds ratios
Date   Thu, 25 Sep 2003 11:53:19 -0500

Sorry about the attachment, here is the document.

Trying to get adjusted percentages from logistic model.  1st way-all
estimates are exactly the same.

xi: svylogit restcever i.insgrp2 i.race i.ppgender i.income3 i.edugp2
i.agecat2 i.newmeds6mos i.numdisgp, or

****Percent va ins who restricts

gen temprest=insgrp2
recode insgrp2 2=1 3=1 4=1 9=1
predict restricted
summarize restricted restcever 
drop insgrp2
gen insgrp2=temprest
drop temprest restricted

gen temprest=insgrp2
recode insgrp2 1=2 3=2 4=2 9=2
predict restricted
summarize restricted restcever 
drop insgrp2
gen insgrp2=temprest
drop temprest restricted

gen temprest=insgrp2
recode insgrp2 1=3 2=3 4=3 9=3
predict restricted
summarize restricted restcever 
drop insgrp2
gen insgrp2=temprest
drop temprest restricted

gen temprest=insgrp2
recode insgrp2 1=4 2=4 3=4 9=4
predict restricted
summarize restricted restcever 
drop insgrp2
gen insgrp2=temprest
drop temprest restricted


gen temprest=insgrp2
recode insgrp2 1=9 2=9 3=9 4=9 
predict restricted
summarize restricted restcever 
drop insgrp2
gen insgrp2=temprest
drop temprest restricted


*********results***************
 xi: svylogit restcever i.insgrp2 i.race i.ppgender i.income3 i.edugp2
i.agecat2 i.newmeds6mos i.numdi
> sgp, or
i.insgrp2         _Iinsgrp2_1-9       (naturally coded; _Iinsgrp2_1 omitted)
i.race            _Irace_1-2          (naturally coded; _Irace_1 omitted)
i.ppgender        _Ippgender_1-2      (naturally coded; _Ippgender_1
omitted)
i.income3         _Iincome3_1-4       (naturally coded; _Iincome3_1 omitted)
i.edugp2          _Iedugp2_1-2        (naturally coded; _Iedugp2_1 omitted)
i.agecat2         _Iagecat2_1-3       (naturally coded; _Iagecat2_1 omitted)
i.newmeds6mos     _Inewmeds6m_1-3     (naturally coded; _Inewmeds6m_1
omitted)
i.numdisgp        _Inumdisgp_1-3      (naturally coded; _Inumdisgp_1
omitted)

Survey logistic regression

pweight:  weight2                                 Number of obs    =
4055
Strata:   <one>                                   Number of strata =
1
PSU:      <observations>                          Number of PSUs   =
4055
                                                  Population size  =
4050.3726
                                                  F(  16,   4039)  =
12.41
                                                  Prob > F         =
0.0000

----------------------------------------------------------------------------
--
   restcever | Odds Ratio   Std. Err.      t    P>|t|     [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
 _Iinsgrp2_2 |   1.707165    .450561     2.03   0.043     1.017552
2.864143
 _Iinsgrp2_3 |   1.473491   .5497295     1.04   0.299     .7090658
3.062022
 _Iinsgrp2_4 |   2.591608   .7683887     3.21   0.001     1.449173
4.634665
 _Iinsgrp2_9 |   3.232883   .9952096     3.81   0.000     1.767984
5.911557
    _Irace_2 |   1.207308   .2069171     1.10   0.272     .8627592
1.689455
_Ippgender_2 |   1.493871   .1999075     3.00   0.003     1.149139
1.94202
 _Iincome3_2 |    1.67865   .3054424     2.85   0.004     1.174983
2.398218
 _Iincome3_3 |   2.320533   .4195796     4.66   0.000     1.627926
3.307813
 _Iincome3_4 |   3.464592    .708747     6.07   0.000     2.319909
5.174082
  _Iedugp2_2 |   .8891192   .1072834    -0.97   0.330     .7018126
1.126416
 _Iagecat2_2 |   .7224912   .1207853    -1.94   0.052     .5205795
1.002716
 _Iagecat2_3 |   .3521471   .0634984    -5.79   0.000     .2472814
.5014836
_Inewmeds6~2 |   1.504512   .2657004     2.31   0.021     1.064208
2.126987
_Inewmeds6~3 |   1.560456   .3182482     2.18   0.029     1.046166
2.327567
_Inumdisgp_2 |   1.700446   .2687467     3.36   0.001     1.247368
2.318094
_Inumdisgp_3 |   2.647208   .4701574     5.48   0.000     1.868811
3.749824
----------------------------------------------------------------------------
--

. 
end of do-file

. do "C:\DOCUME~1\VHAANN~2\LOCALS~1\Temp\STD03000000.tmp"

. gen temprest=insgrp2

. recode insgrp2 2=1 3=1 4=1 9=1
(insgrp2: 3727 changes made)

. predict restricted
(option p assumed; Pr(restcever))

. summarize restricted restcever 

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
  restricted |      4061    .1682303    .1245745   .0125673   .7723164
   restcever |      4061    .1652302     .371434          0          1

. drop insgrp2

. gen insgrp2=temprest

. drop temprest restricted

. 
end of do-file

. do "C:\DOCUME~1\VHAANN~2\LOCALS~1\Temp\STD03000000.tmp"

. gen temprest=insgrp2

. recode insgrp2 1=2 3=2 4=2 9=2
(insgrp2: 1318 changes made)

. predict restricted
(option p assumed; Pr(restcever))

. summarize restricted restcever 

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
  restricted |      4061    .1682303    .1245745   .0125673   .7723164
   restcever |      4061    .1652302     .371434          0          1

. drop insgrp2

. gen insgrp2=temprest

. drop temprest restricted

. 
end of do-file

. do "C:\DOCUME~1\VHAANN~2\LOCALS~1\Temp\STD03000000.tmp"

. gen temprest=insgrp2

. recode insgrp2 1=3 2=3 4=3 9=3
(insgrp2: 3870 changes made)

. predict restricted
(option p assumed; Pr(restcever))

. summarize restricted restcever 

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
  restricted |      4061    .1682303    .1245745   .0125673   .7723164
   restcever |      4061    .1652302     .371434          0          1

. drop insgrp2

. gen insgrp2=temprest

. drop temprest restricted

. 
end of do-file

. do "C:\DOCUME~1\VHAANN~2\LOCALS~1\Temp\STD03000000.tmp"

. gen temprest=insgrp2

. recode insgrp2 1=4 2=4 3=4 9=4
(insgrp2: 3550 changes made)

. predict restricted
(option p assumed; Pr(restcever))

. summarize restricted restcever 

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
  restricted |      4061    .1682303    .1245745   .0125673   .7723164
   restcever |      4061    .1652302     .371434          0          1

. drop insgrp2

. gen insgrp2=temprest

. drop temprest restricted

. 
. 
. gen temprest=insgrp2

. recode insgrp2 1=9 2=9 3=9 4=9 
(insgrp2: 3779 changes made)

. predict restricted
(option p assumed; Pr(restcever))

. summarize restricted restcever 

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
  restricted |      4061    .1682303    .1245745   .0125673   .7723164
   restcever |      4061    .1652302     .371434          0          1

. drop insgrp2

. gen insgrp2=temprest

. drop temprest restricted

. 
end of do-file

. 


2nd way.  Manually create all of the dummies.

svylogit restcever insgrp2b insgrp2c insgrp2d insgrp2e $demog, or

****Percent va ins who restricts

gen temprest=insgrp2a
recode insgrp2a 0=1
predict restricted
summarize restricted restcever 
drop insgrp2a
gen insgrp2a=temprest
drop temprest restricted

****Percent private ins who restricts

gen temprest=insgrp2b
recode insgrp2b 0=1
predict restricted
summarize restricted restcever 
drop insgrp2b
gen insgrp2b=temprest
drop temprest restricted


****Percent medicaid ins who is worried who restricts

gen temprest=insgrp2c
recode insgrp2c 0=1
predict restricted
summarize restricted restcever 
drop insgrp2c
gen insgrp2c=temprest
drop temprest restricted


****Percent medicare ins who restricts

gen temprest=insgrp2d
recode insgrp2d 0=1
predict restricted
summarize restricted restcever 
drop insgrp2d
gen insgrp2d=temprest
drop temprest restricted


****Percent no ins who restricts

gen temprest=insgrp2e
recode insgrp2e 0=1
predict restricted
summarize restricted restcever 
drop insgrp2e
gen insgrp2e=temprest
drop temprest restricted

**********************results*******************

. svylogit restcever insgrp2b insgrp2c insgrp2d insgrp2e $demog, or

Survey logistic regression

pweight:  weight2                                 Number of obs    =
4055
Strata:   <one>                                   Number of strata =
1
PSU:      <observations>                          Number of PSUs   =
4055
                                                  Population size  =
4050.3726
                                                  F(  16,   4039)  =
12.41
                                                  Prob > F         =
0.0000

----------------------------------------------------------------------------
--
   restcever | Odds Ratio   Std. Err.      t    P>|t|     [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
    insgrp2b |   1.707165    .450561     2.03   0.043     1.017552
2.864143
    insgrp2c |   1.473491   .5497295     1.04   0.299     .7090658
3.062022
    insgrp2d |   2.591608   .7683887     3.21   0.001     1.449173
4.634665
    insgrp2e |   3.232883   .9952096     3.81   0.000     1.767984
5.911557
       racea |   1.207308   .2069171     1.10   0.272     .8627592
1.689455
     gendera |   1.493871   .1999075     3.00   0.003     1.149139
1.94202
     incomea |    1.67865   .3054424     2.85   0.004     1.174983
2.398218
     incomeb |   2.320533   .4195796     4.66   0.000     1.627926
3.307813
     incomec |   3.464592    .708747     6.07   0.000     2.319909
5.174082
    agecat2a |   .7224912   .1207853    -1.94   0.052     .5205795
1.002716
    agecat2b |   .3521471   .0634984    -5.79   0.000     .2472814
.5014836
        edua |   .8891192   .1072834    -0.97   0.330     .7018126
1.126416
newmeds6mosa |   1.504512   .2657004     2.31   0.021     1.064208
2.126987
newmeds6mosb |   1.560456   .3182482     2.18   0.029     1.046166
2.327567
   numdisgpa |   1.700446   .2687467     3.36   0.001     1.247368
2.318094
   numdisgpb |   2.647208   .4701574     5.48   0.000     1.868811
3.749824
----------------------------------------------------------------------------
--

. 
. ****Percent va ins who restricts
. 
. gen temprest=insgrp2a

. recode insgrp2a 0=1
(insgrp2a: 3727 changes made)

. predict restricted
(option p assumed; Pr(restcever))

. summarize restricted restcever 

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
  restricted |      4061    .1682303    .1245745   .0125673   .7723164
   restcever |      4061    .1652302     .371434          0          1

. drop insgrp2a

. gen insgrp2a=temprest

. drop temprest restricted

. 
. ****Percent private ins who restricts
. 
. gen temprest=insgrp2b

. recode insgrp2b 0=1
(insgrp2b: 1318 changes made)

. predict restricted
(option p assumed; Pr(restcever))

. summarize restricted restcever 

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
  restricted |      4061    .1961565    .1529727   .0212655   .8527421
   restcever |      4061    .1652302     .371434          0          1

. drop insgrp2b

. gen insgrp2b=temprest

. drop temprest restricted

. 
. 
. ****Percent medicaid ins who is worried who restricts
. 
. gen temprest=insgrp2c

. recode insgrp2c 0=1
(insgrp2c: 3870 changes made)

. predict restricted
(option p assumed; Pr(restcever))

. summarize restricted restcever 

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
  restricted |      4061    .2181586    .1438504   .0184083   .8332825
   restcever |      4061    .1652302     .371434          0          1

. drop insgrp2c

. gen insgrp2c=temprest

. drop temprest restricted

. 
. 
. ****Percent medicare ins who restricts
. 
. gen temprest=insgrp2d

. recode insgrp2d 0=1
(insgrp2d: 3550 changes made)

. predict restricted
(option p assumed; Pr(restcever))

. summarize restricted restcever 

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
  restricted |      4061    .2958942    .1716523   .0319308   .8978642
   restcever |      4061    .1652302     .371434          0          1

. drop insgrp2d

. gen insgrp2d=temprest

. drop temprest restricted

. 
. 
. ****Percent no ins who restricts
. 
. gen temprest=insgrp2e

. recode insgrp2e 0=1
(insgrp2e: 3779 changes made)

. predict restricted
(option p assumed; Pr(restcever))

. summarize restricted restcever 

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
  restricted |      4061    .3422888    .1727728   .0395197   .8978642
   restcever |      4061    .1652302     .371434          0          1

. drop insgrp2e

. gen insgrp2e=temprest

. drop temprest restricted

. 
. 
end of do-file

. 

3rd way: use adjust

xi: svylogit restcever i.insgrp2 i.race i.ppgender i.income3 i.edugp2
i.agecat2 i.newmeds6mos i.numdisgp, or
adjust, by(insgrp2) pr


*******************results**********************
. adjust, by(insgrp2) pr

----------------------------------------------------------------------------
---------------------------
     Dependent variable: restcever     Command: svylogit
   Variables left as is: _Iinsgrp2_2, _Iinsgrp2_3, _Iinsgrp2_4, _Iinsgrp2_9,
_Irace_2, _Ippgender_2,
                         _Iincome3_2, _Iincome3_3, _Iincome3_4, _Iedugp2_2,
_Iagecat2_2, _Iagecat2_3,
                         _Inewmeds6~2, _Inewmeds6~3, _Inumdisgp_2,
_Inumdisgp_3
----------------------------------------------------------------------------
---------------------------

----------------------
  insgrp2 |         pr
----------+-----------
        1 |     .08082
        2 |     .12135
        3 |    .240155
        4 |    .176516
        9 |    .306773
----------------------
     Key:  pr  =  Probability




-----Original Message-----
From: Eby, Elizabeth 
Sent: Thursday, September 25, 2003 10:58 AM
To: '[email protected]'; Copeland, Laurel
Subject: RE: adjusted percentages and adjusted odds ratios


Hi again,  I have attached some more information regarding the methods I am
using to get the adjusted percentages.  A couple of questions:

In method one, I use the xi.svylogit method and all of the estimates are the
same.  Can anyone explain why?  So, in method two, I manually created the
dummies and got different estimates on all levels.  But, then in method
three, I simply ran an adjust statement after the model, and I got entirely
different estimates than the predict command in method 2.  Could someone
help me understand why these two methods give different results and which is
the better method?

Note about the data.  It is a nationally representative sample of adults
with at least one chronic illness.  We are trying to say that when adjusted
by SES and other clinical covariates, less VA patients restrict their
medications than do people with the other types of insurance.

Thank you for your help,
Elizabeth Eby
Ann Arbor VAMC

-----Original Message-----
From: Eby, Elizabeth 
Sent: Friday, September 19, 2003 11:47 AM
To: '[email protected]'
Subject: adjusted percentages and adjusted odds ratios


Hi-
Could someone help me out with understanding the relatively small difference
in adjusted percentages (20% vs 17%) compared to a more robust adjusted odds
ration of 1.7?  The adjusted percentages are controlling for covariates, and
were obtained using the predict sequence.

Thank you,

Elizabeth Eby
Research Health Science Specialist
Ann Arbor VAMC
734-769-7100 X6248

-----Original Message-----
From: Copeland, Laurel 
Sent: Friday, September 19, 2003 11:28 AM
To: Eby, Elizabeth
Subject: RE: adjusted percentages


I don't know. Maybe put the question to Statalist?

-----Original Message-----
From: Eby, Elizabeth 
Sent: Friday, September 19, 2003 11:27 AM
To: Copeland, Laurel
Subject: RE: adjusted percentages

This hold even though those are adjusted percentages?

-----Original Message-----
From: Copeland, Laurel 
Sent: Friday, September 19, 2003 11:26 AM
To: Eby, Elizabeth
Cc: VHAANN HSRD Statistical Group
Subject: RE: adjusted percentages


The raw odds ratio can be calculated...17% of 334=277, 20% of 2741=2193
	cut back?
	    no  yes
priv no   277  57
ins? yes 2193 548

OR = (277/57) / (2193/548)
   =  4.86  /  4.00
   = approx 1.22
The remainder of the effect in the adjusted OR must be due to the
covariates.

-----Original Message-----
From: Eby, Elizabeth 
Sent: Friday, September 19, 2003 11:05 AM
To: VHAANN HSRD Statistical Group
Subject: adjusted percentages

How would you explain the small difference in the adjusted percentages (17%
vs 20%) with an odds ratio of 1.7 (p=.04)?  Does it have anything to do with
the underlying sample sizes of the 2 groups (n=334 VA patients and n=2741
with private insurance)?

Thanks.

-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Friday, September 19, 2003 10:51 AM
To: [email protected]
Subject: 

Liz - can you double check this?  THe difference in %'s seem small relative
to
the AOR.

Controlling for their sociodemographic characteristics, number of chronic
diseases, and number of prescription medications, 17% of VA patients cut
back
on medication use due to cost compared to 20 % of those with private
insurance
(adjusted odds ratio [AOR]: 1.7, p=.04),
*
*   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