Statalist


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

Re: st: predictive margins not estimable in svy


From   "Michael I. Lichter" <[email protected]>
To   [email protected]
Subject   Re: st: predictive margins not estimable in svy
Date   Fri, 07 Aug 2009 20:40:14 -0400

Ah, I see. (Susan said it was Stata 10.)

Three things. First, Susan uses these two commands:

	svy, subpop(subpopnodm): logistic pad i.x age56 sex01 race2
	margins i.x , subpop(if subpopnodm==1)

Are these the same subpopulation? They might have to be.
Second, the online help for -margin- (http://www.stata.com/help.cgi?margins) says:

       *vce(unconditional)* specifies that the covariates that are not fixed
           be treated in a way that accounts for their having been sampled.
           The VCE is estimated using the linearization method.  This method
           allows for heteroskedasticity or other violations of
           distributional assumptions and allows for correlation among the
           observations in the same manner as *vce(robust)* and *vce(cluster*
           /.../*)*, which may have been specified with the estimation command.
           This method also accounts for complex survey designs if the data
           are *svyset*. See /Obtaining margins with survey data and/
           /representative samples/ in *[R] margins*.

This makes
	margins i.x , subpop(if subpopnodm==1) *vce(unconditional)*

look likely, and if that doesn't work, try the advice at the end of that paragraph -- "See /Obtaining margins with survey data and/ /representative samples/ in *[R] margins*."

-ml


Martin Weiss wrote:
<>

Upgrade to 11 to get it...


http://www.stata.com/stata11/margins.html



HTH
Martin


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Michael I. Lichter
Sent: Samstag, 8. August 2009 02:25
To: [email protected]
Subject: Re: st: predictive margins not estimable in svy

Susan,

Where did you get this -margins- command? It's not part of Stata 10, and -findit- doesn't show anything.

-ml

[email protected] wrote:
Hello,

I am having problems using the Stata 10 "margins" command with survey
data.
I have a created a subpop of ~2500 observations (total 5000+) and would
like to obtain the age- sex- race adjusted prevalence of my dichotomous
outcome by cystatin-c quartile. Data is svyset; svy logistic model
including age, sex and race and cystatin-c was run, followed by the
marginals command.
The output says (not estimable). (below)

Can anyone help?  I do get estimations if I take it out of survey mode,
Thanks,
Sue

. svy, subpop(subpopnodm): logistic pad i.x age56 sex01 race2
(running logistic on estimation sample)

Survey: Logistic regression

Number of strata = 28 Number of obs = 5684 Number of PSUs = 57 Population size = 230532837 Subpop. no. of obs = 2472
                                               Subpop. size       =
90812359.8
Design df = 29 F( 6, 24) = 28.73 Prob > F = 0.0000

------------------------------------------------------------------------------
             |             Linearized
         pad | Odds Ratio   Std. Err.      t    P>|t|     [95% Conf.
Interval]
-------------+----------------------------------------------------------------
           x |
2 | 1.521746 .5364044 1.19 0.243 .7400256 3.12923 3 | 4.057542 2.135947 2.66 0.013 1.382564 11.90805 4 | 9.510348 3.931692 5.45 0.000 4.083106 22.15145
             |
age56 | 4.655526 2.164545 3.31 0.003 1.798843 12.04881 sex01 | 1.14324 .236113 0.65 0.522 .749361 1.744149 race2 | 2.314983 .5035135 3.86 0.001 1.483732 3.611936
------------------------------------------------------------------------------

. margins i.x , subpop(if subpopnodm==1)

Predictive margins Number of obs = 3009 Subpop. no. obs = 2472
Model VCE    : Linearized

Expression   : Pr(pad), predict()

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      z    P>|z|     [95% Conf.
Interval]
-------------+----------------------------------------------------------------
           x |
          1  |  (not estimable)
          2  |  (not estimable)
          3  |  (not estimable)
          4  |  (not estimable)
------------------------------------------------------------------------------



*
*   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/


--
Michael I. Lichter, Ph.D. <[email protected]>
Research Assistant Professor & NRSA Fellow
UB Department of Family Medicine / Primary Care Research Institute
UB Clinical Center, 462 Grider Street, Buffalo, NY 14215
Office: CC 126 / Phone: 716-898-4751 / FAX: 716-898-3536

*
*   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/



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