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

# Re: st: Obtaining 95%CI for marginal effect

 From Nur Hafidha Hikmayani To statalist@hsphsun2.harvard.edu Subject Re: st: Obtaining 95%CI for marginal effect Date Sun, 6 Feb 2011 21:59:14 +0700

```Thanks Steve.
I'm afraid however that I'm not clear enough when some independent
variables are categorical. You gave an example in which weight and
turn are numerical variables - in my case, there is only 1 numerical
IV. Suppose foreign is the main IV of interest and other covariates
are mostly categorical, can we use -adjust- too (perhaps with

hafida-

On Sun, Feb 6, 2011 at 9:12 PM, Steven Samuels <sjsamuels@gmail.com> wrote:
> Nur-
>
> I apologize. I checked and discovered -adjust- after -svy: reg- does not
> compute predictions at the weighted means of the covariates, only at the
> unweighted means. As a work-around, you could substitute the weighted means
> by hand.
>
> ****************************
> sysuse auto, clear
> drop if rep78==.
> svy: mean weight turn   //get survey weighted means
> xi: svy: reg mpg weight turn i.foreign
> adjust weight= 3138.575 turn=40.33816, by(foreign) ci se
> *****************************
>
> Steve
> sjsamuels@gmail.com
>
>
> Nur-
>
> Use -adjust- with the -ci- option.  The fitted value of y is not a "marginal
> effect";  for -regress- or (-svy: regress-) the default marginal effects are
> the regression coefficients.
>
> *********************
> sysuse auto, clear
> xi: reg weight price turn i.foreign
> adjust price turn, by(foreign), se ci
> ******************
>
> Steve
> sjsamuels@gmail.com
>
> On Feb 6, 2011, at 7:02 AM, Nur Hafidha Hikmayani wrote:
>
> Dear all,
> I've been running some regression models using -svy- and estimating
> its marginal effect using -mfx- (I use Stata 10.1).
> I wonder how can I get the 95% CI for the marginal effects (y)?
>
> The output for regression and its marginal effect are as follows:
>
> . xi: svy: reg GH i.medgrp exgrp chronic nummed gp
> ------------------------------------------------------------------------------
>          |             Linearized
>       GH |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
> -------------+----------------------------------------------------------------
> _Imedgrp_1 |   4.429839    3.56263     1.24   0.214    -2.564628    11.42431
> _Imedgrp_2 |   8.333728   3.633545     2.29   0.022     1.200035    15.46742
> _Imedgrp_3 |   10.05818   3.773961     2.67   0.008     2.648813    17.46755
>    exgrp |  -8.916839    1.89046    -4.72   0.000    -12.62835   -5.205324
>  chronic |  -10.31767   1.936802    -5.33   0.000    -14.12017   -6.515169
>   nummed |  -1.063043   .3452676    -3.08   0.002    -1.740902   -.3851831
>       gp |  -4.347845   1.773649    -2.45   0.014    -7.830027    -.865663
>    _cons |   83.19335   3.520136    23.63   0.000     76.28231    90.10438
> ------------------------------------------------------------------------------
>
> . mfx, at(mean _Imedgrp_1=0 _Imedgrp_2=0)
> Marginal effects after svy:regress
>   y  = Fitted values (predict)
>      =  53.085624
> ------------------------------------------------------------------------------
> variable |      dy/dx    Std. Err.     z    P>|z|  [    95% C.I.   ]      X
> ---------+--------------------------------------------------------------------
> _Imedg~1*|   4.429839     3.56263    1.24   0.214  -2.55279  11.4125
> 0
> _Imedg~2*|   8.333728     3.63354    2.29   0.022   1.21211  15.4553
> .379185
> _Imedg~3*|   10.05818     3.77396    2.67   0.008   2.66136   17.455
> 0
> exgrp*|  -8.916839     1.89046   -4.72   0.000  -12.6221 -5.21161   .762312
> chronic*|  -10.31767      1.9368   -5.33   0.000  -14.1137 -6.52161
>  .83752
> nummed |  -1.063043      .34527   -3.08   0.002  -1.73975 -.386331   6.69376
>   gp*|  -4.347845     1.77365   -2.45   0.014  -7.82413 -.871558   .472814
> ------------------------------------------------------------------------------
> (*) dy/dx is for discrete change of dummy variable from 0 to 1
>
>
> Any help is much appreciated,
> Thanks,
> hafida-
>
> *
> *   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/
>
> *
> *   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/
>

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