Announcement

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

  • Test if variance on random intercepts are 0 (svy: melogit)

    I am using survey weighted data with two (nested) random intercepts. I would like to test if the variances of the random intercepts are 0.
    The lrtest command will not work, since I have used svy:melogit.

    I looked at this post but my context is different enough such that I don't know the correct code.

    Code:
    * Set weights
    svyset occ_group_cat, weight(weight_occ_cat) strata(state_abbr) || occ_cat, weight(weight_occ) strata(state_abbr)  || _n, weight(weight_respondent_rescale) strata(state_abbr) 
    
    
    *(Nested) random intercept model
    svy: melogit t_tested_14d_dummy b1.gender b1.age_bucket b1.education b1.race_ethnicity b1.state_abbr ///
                                    comorbid_Type1D comorbid_Type2D comorbid_Cancer comorbid_HeartDis comorbid_HighBP ///
                                    comorbid_Asthma comorbid_ChronLungD comorbid_KidneyD comorbid_AutoImm comorbid_WeakImm ///
                                    comorbid_Missing ///
                                    b1.worry_catch_COVID_C9 ///
                                    c.perc_Rep_2020_sc c.incid_prop_7dma_jhu_sc c.PVI_pop_conc_density_sc ///
                                    || occ_group_cat: || occ_cat:, intpoints(2) startgrid(.11) intmethod(mcaghermite) iterate(5000)

    Without showing full results, the variance estimates are as follows:
    Click image for larger version

Name:	Screenshot 2023-08-25 125013.jpg
Views:	1
Size:	66.8 KB
ID:	1725080



    I want to perform two tests: whether the variances for the random intercepts (occ_group_cat and occ_cat) are equal to 0.

    My (wrong) code is as follows:

    Code:
    test _b[var(occ_group_cat:_cons)] = 0
    test _b[var(occ_cat:_cons)] = 0

    Thank you very much.

  • #2
    Duplicate post. If interested, see https://www.statalist.org/forums/for...=1692991619997

    Comment

    Working...
    X