Bookmark and Share

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

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

Re: st: Computing margins for a subpop in svy with BRR weights

From   Steve Samuels <>
Subject   Re: st: Computing margins for a subpop in svy with BRR weights
Date   Thu, 17 Oct 2013 22:07:45 -0400

Welcome to Statalist, Richard.  

> 1. Since the equation in line 13 is not specifying “svy, subpop(missing_vars==0):” (it won’t run if I include this), do I need to be concerned that the resulting standard errors are incorrectly computed?  Or does the “svy brr _b” command in line 15 take care of this?

The standard errors are correct. If you look again at the -help- for -margins-, you will see that your subpop() statement is in the right place. 

> 2. Is the “coeff” column in the final table indicating the dy/dx for each indep var—that is, the dy/dx computed based on the pweights and brr weights in the svy?

Yes, but you could have seen this for yourself by running your -biprobit- outside your program, with a  [pweight=] statement and an  "if" statement to subset to your subpopulation .  With survey data, stimated marginal effects are functions only of the probability weights, and you should see that the nicely formatted effects match those in the "coeff" column of your results. (The stratification, replicate weights, and subpop() options influence only the standard errors.)


On Oct 16, 2013, at 5:26 AM, Carpiano , Richard wrote:

Dear Stata List members,

Sorry for resending this posting--this version hopefully won't be cut off in the archive mid-message...  Best, Rich Carpiano (first time poster)

Greetings.  I am writing to inquire about properly specifying syntax for computing margins for a subpop in a svyset datafile.  To be sure, I have attempted to be as succinct as possible in this note, but it is a little tough given the nature of the problem.

I am trying to compute average marginal effects on a subpop from a svyset datafile that uses brr weights.  Though replication weights are not supported with the margins command, Stata 13’s manual on page 114 (under -svy postestimation-) provides programming code that one can run to obtain those margin estimates.  Here is that program syntax from the manual:

program mymargins, eclass
version 13
syntax anything [if] [iw pw]
if "`weight'" !=3D "" {
local wgtexp "[`weight' `exp']"
set buildfvinfo on
`anything' `if' `wgtexp'
margins race, post
*NB: separated the letters with asterisks only b/c this seems to be the culprit for the missing remainder of earlier posts

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