Bookmark and Share

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


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

Re: st: Using command svy glm to obtain risk ratios


From   Steve Samuels <sjsamuels@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Using command svy glm to obtain risk ratios
Date   Mon, 17 Feb 2014 17:59:51 -0500

Well, Amenah wanted log-binomial, but that works too:


webuse nhanes2
svy : glm highbp age, fam(bin) link(log)
svy : glm highbp age, fam(bin) link(log) eform

This question would be easier to repspond to if Amenah had followed the
request in the FAQ to show us exactly what he or she typed and what Stata
reported.

Steve

On Feb 17, 2014, at 11:13 AM, Stas Kolenikov <skolenik@gmail.com> wrote:

It seems to work in Stata 13:

webuse nhanes2
svy : glm highbp age, fam(bin) link(logit)
svy : glm highbp age, fam(bin) link(logit) eform

There may be situations when -svy- takes over formatting of the
output, so the formatting options of the command that it applies to do
not matter... which is rather unfortunate, but that's the price you
have to pay for the generality of -svy-. Arguably, there may be a room
for -svy, eform:- option for situations like this. You can then try
running just -glm, eform- which forces Stata to (1) go back to -glm-,
(2) figure out that you only want to redisplay the results in risk
ratios format; (3) do just that using the existing e(b) and e(V), with
the latter correcting for the sampling design.


-- Stas Kolenikov, PhD, PStat (ASA, SSC)
-- Principal Survey Scientist, Abt SRBI
-- Opinions stated in this email are mine only, and do not reflect the
position of my employer
-- http://stas.kolenikov.name



On Mon, Feb 17, 2014 at 9:47 AM, Agunwamba, Amenah A., Ph.D.
<Agunwamba.Amenah@mayo.edu> wrote:
> Hello Stata Experts,
> 
> I'm attempting to obtain risk ratios using weighted survey data. I'm using a binary outcome. For a simple model, I use the following code:
> 
> Svy: glm outcome predictor, fam(binomial) link(log) eform
> 
> Stata then does some "thinking.....", and takes forever to finally produce a table that has only coefficients and standard errors, but not the risk ratios that I am looking for. Is there something wrong with my data or my code? How would I assess if there' something wrong with the data (eg: convergence, etc?)
> 
> I believe I need to use the svy command to incorporate weighting. I was able to obtain risk ratios without the svy command, but I need to use weights. Any suggestions on different commands I could use to get the results I'm looking for?
> 
> Thanks in advance,
> 
> 
> *
> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index