Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • xtgee: Can family(binomial) be used when the response variable is a proportion?

    Dear Statalist forum members,

    Can family(binomial) be used in xtgee to assess proportions (e.g., percent of hospitalizations resulting in readmission)? Or can it only be used for binary outcomes (hospitalized yes/no)?
    I wish to model the relationship between hosp_hhi and readmission_rate_pc using xtgee, where readmission rate is a continuous variable ranging between 0 and 1. Is the use of family(binomial) appropriate for this case?

    xtset hospital_center_id
    xtgee readmission_rate_pc hosp_hhi, family(binomial) link(logit) corr(independent) vce(robust)

    Thank you.

  • #2
    Originally posted by Susan Gutierrez View Post
    Can family(binomial) be used in xtgee to assess proportions (e.g., percent of hospitalizations resulting in readmission)?
    Yes, but inasmuch as you're specifying an independent working correlation structure, you might as well use the corresponding glm estimation command, or even fracreg logit.

    Especially if you have only a single observation per hospital, it wouldn't be worth the extra effort to use xtgee and xtset.

    You can see by running the example code below (complete do-file and its log file attached for convenience) that all three commands give identical results regardless of whether you have single or multiple observations per hospital so long as you're specifying an independent working correlation structure with xtgee.
    Code:
    version 18.0
    
    clear *
    
    // seedem
    set seed 2104812139
    
    /* Single observation per hospital */
    quietly set obs 250
    generate int hid = _n
    generat double out = runiform()
    generate double hhi = runiformint(1, 100)
    
    xtgee out c.hhi, i(hid) family(binomial) link(logit) corr(independent) vce(robust) nolog
    
    glm out c.hhi, family(binomial) link(logit) vce(robust) nolog
    
    fracreg logit out c.hhi, vce(robust) nolog
    
    /* Multiple observations per hospital */
    quietly expand 3
    quietly replace out = runiform()
    quietly replace hhi = runiformint(1, 100)
    
    xtgee out c.hhi, i(hid) family(binomial) link(logit) corr(independent) vce(robust) nolog
    
    glm out c.hhi, family(binomial) link(logit) vce(cluster hid) nolog
    
    fracreg logit out c.hhi, vce(cluster hid) nolog
    
    exit
    Note that glm will give you a helpful reminder that your outcome variable contains noninteger values.
    Attached Files

    Comment

    Working...
    X