Announcement

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

  • Multilevel modelling using melogit in combination with svyset

    Hello everyone

    I am reanalyzing DHS (nationally representative household survey) data from Nigeria on children's vaccination status. I am trying to fit a multilevel logistic model using the following code:

    svyset hh1, weight(chweight) strata(hh6n)
    svy: melogit measles || hh7n:

    But get the following error message:
    hierarchical groups are not nested within hh1

    Which I don't think is true. I checked over and over again, and from what I can tell hh7n IS nested within hh1.

    So I was trying to circumvent the problem by fitting the following model instead
    melogit measles hh6n || hh7n: || hh1: , pweight(chweight)

    From what I understand of survey analyses, these two should be equivalent, but I am not sure. Also because I don't seem to find any documentation of what svyset does 'in the background'.

    Any thoughts on this would be highly appreciated!

    Thanks, Sandra

  • #2
    I will say that the names of your variables make it very easy to get confused. I advise renaming them to something more informative. I'd like to know more about your design also and what each of the variables is. For simplicity I'll rename hh6n "stratum". "

    Also your code would be easier read if you followed the request in FAQ 12, to show real code and results, between CODE delimiters. In your second melogit you are treating your stratum variable as a numerical covariate. Is that what you intended?

    I think that the following two approaches will give equivalent results. However I've not tried them on real data, so please let us know what you find. For more advice, see Example 6 in the Manual entry for meglm. There is a reference to Rabe-Hesketh and Skrondal's approach to scaling the weights. I believe that the scaling is important if you want to estimate variance components at every level. I suggest you see if weight scaling makes a difference in your conclusions.

    * melogit without svyset
    1. You need a conditional weight at every level of your model, whether sampled or not.( A conditional weight is the inverse of the conditional probability of selection at that levels.) If the unit was not sampled (i.e. all units at the level were selected), use a nominal weight of 1.

    2. Your stratum variable should be the highest level of your multilevel model and receive the nominal weight of 1. Below I've defined a variable wt7n containing the conditional weight for your hh7n unit and wt1, the weight for hh1.
    Code:
    gen one = 1
    melogit measles [pw = chweight] || hh7n:, pweight(wt7n) || hh1:,pweight(wt1)|| stratum:, pweight(one)
    * svyset then melogit
    Code:
    svyset hh1 , weight(one)  strata(stratum) || hh7n, weight(wt7n) || _n, weight(chweight)
    svy: melogit measles
    Note, that I've slipped in your hh7n variable as a sampling level.
    Last edited by Steve Samuels; 11 May 2018, 16:52.
    Steve Samuels
    Statistical Consulting
    [email protected]

    Stata 14.2

    Comment


    • #3
      Hello everyone,

      I am quite new multilevel modeling and application of survey weights in this method. If some can help me, I really appreciate it.
      I have similar question. I am applying two level multilevel logit model. My data observed households and individuals within the households for food shopping events for one week. My data is survey data and survey weights are for households not individuals. In the code book the following is stata codes for applying survey weights:

      svyset tspsu [pweight=hhwgt], singleunit(certainty) strata(tsstrata).

      My question is should I need to rescaling my survey weigts? If I need to rescaling, how can I do it?

      Actually, I applied the following code, but I am not sure whether I correctly specified survey weights or not.

      melogit supmarket c.placetime_d##i.educcat c.price_index_place i.AGE_R i.race i.sex i.employment hhsize i.kid i.marital i.vehiclenum i.income i.new_meat i.new_diary i.new_veg_fru i.new_long_last food_index i.ebt_snap i.amount i.rural i.region || hhnum:, pweight(hhwgt).

      Please, could you help me to apply survey weights into my model? Thanks in advance.



      Comment

      Working...
      X