Announcement

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

  • How to add sampling weight in multilevel mixed model

    Hi all, I am having trouble adding sampling weight to my multilevel mixed model. Please see my syntax below:

    Code:
    svyset [pweight = wt_sa3], brrweight(wt_sa3_repl_01 - wt_sa3_repl_32) vce(brr)
    No problem with the above command, however when I keep tying the following syntax:

    Code:
    svy: meglm sa3lw_w age retain_k if _treated!=. || StudentID:, cov(un)
    I got an error message:

    Code:
     svy: meglm sa3lw_w age retain_k if _treated!=. || StudentID:, cov(un)
    invalid interaction specification;
    '|' may not be used with continuous variables
    Any clue of why this is happening and how to fix this please? Thanks!

  • #2


    I don't know the exact reason for the error message you saw, but the syntax would be incorrect in any case. Take a look at the survey data section in the Manual entry meglm. You will see that you must specify a pweight() option for each level of mixed effects model. Here's one example of code that I tried:
    Code:
    svyset _n [pw= pwgtp] , brrweight(pwgtp1-pwgtp80) vce(brr)
    svy: meglm  agep sex , pweight(pwgtp1-pwgtp80)  || state:, pweight(statewt)
    I get an error message
    Code:
    meglm is not supported by svy with vce(brr);see help svy estimation for a list of Stata estimation
    commands that are supported by svy
    r(322);
    The list referred to does contain meglm and other me commands, but apparently multilevel analyses and replicate weights are incompatible.
    Last edited by Steve Samuels; 18 Sep 2017, 17:53.
    Steve Samuels
    Statistical Consulting
    [email protected]

    Stata 14.2

    Comment


    • #3
      Hi Steve, thanks so much for your reply. If multilevel analyses and replicate weights cannot work together, what suggestions do you have for me if I do need to run a HLM model and the only sampling weight I have in the data is replicate sampling weights? In other words, what are the remedies for me in this occasion?

      If you want to know more about the data, you can go to this link: https://seels.sri.com/seels_textonly/studydesign.htm

      Below I also give you a screenshot of all the sampling weights provided by the data and as you can see, there are no other sampling weight options other than the replicate ones.


      Click image for larger version

Name:	Screen Shot 2017-09-15 at 5.46.01 PM 1.png
Views:	1
Size:	228.6 KB
ID:	1410955



      Comment

      Working...
      X