Announcement

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

  • Adding weight to a procedure testing ICC of 2 groups for equality

    Hello,

    I'm using a program code in Stata 13.0 that examines, if two ICCs (one per group) significantly differ between groups. It runs for unweighted groups, but when adding a weight variable (I previously computed) the same results as for unweighted groups are produced. No error message occurs.

    Code:
    Code:
    capture program drop icc_comp
    program define icc_comp
    
    syntax anything  [if/] [iw/] , id(varname)
    
    * 1. argument = outcome 
    * 2. argument = group variable
    
    quietly tabulate `2' , generate(`2'___)
    
    mixed `1'  `id'  `2' || `id' : `2'___*  , noconstant residual(independent, by(`2')) nolrtest nolog
    
    estimates store Full
    
    display in smcl as text "rho 0 = " exp(_b[lns1_1_1:_cons])^2 / ///
         (exp(_b[lns1_1_1:_cons])^2 + exp(_b[lnsig_e:_cons])^2)
    
      display in smcl as text "rho 1 = " exp(_b[lns1_1_2:_cons])^2 / ///
         (exp(_b[lns1_1_2:_cons])^2 + exp(_b[r_lns2ose:_cons] + _b[lnsig_e:_cons])^2)
    
      quietly mixed `1' || `id': , nolrtest nolog
    
      local linesize `c(linesize)'
    
      set linesize 80
    
      lrtest Full
    
      set linesize `linesize'
    
      drop `2'___*  _est_Full
    
    end
    One example: I used for the unweighted analysis "icc_comp N group , id(id)" and for the weighted analysis "icc_comp N group [iw=weight], id(id)". As said before, exactely the same values occured without an error message (for every analysis of my 7 outcome variables).

    Does someone know how I have to alter the program code so that the weight variable is not ignored?

    Thanks in advance and best regards,
    Sabine

  • #2
    You might have better luck getting replies if you post this in the General forum.

    For now, here are two comments:

    1. Your wrapper program accepts importance weights, but doesn't do anything with them, doesn't pass it through to mixed. (ditto with the if restriction.)

    2. mixed doesn't allow importance weights.

    Comment


    • #3
      Thanks for your reply Joseph, I posted the question in the General forum as you suggested!

      Comment

      Working...
      X