Announcement

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

  • Getting standard deviations when data require svy: for analysis and are multiply-imputed

    Any help with this problem would be gratefully received.

    Some background: I am trying to collate the mean, standard deviation and number of observations for around 150 organisations so I can output the results into funnelplot using funnelcompar. The data are from a survey, have nonresponse weights and are clustered so I need to use the svyset command to instruct Stata to generate all statistics, taking account of the nonresponse weights and the finite population correction.

    When I have non-imputed data (and even for collecting the mean for imputed data) this is fairly easy to do. My strategy has been to run svy: mean yvar, over(clustervar) (and follow-up with estat sd)
    and transfer the saved estimates (in return and ereturn) to a matrix and then post this matrix to data file that I can use in funnelcompar. The difficulty arises generating the standard deviation when the data are multiply-imputed.

    I found this solution by Stas Kolenikov to generate the standard deviation in these circumstances on a different forum: mi xeq : generate y2 = y*y

    mi estimate (sd : sqrt( _b[y2] - _b[y]*_b[y] ) ) : svy : mean y y2 mi testtransform sd This does give a standard deviation in the right ballpark, but the problem is that what is saved in ereturn and return are the results of the test that mi testttransform runs not the input to that test, i.e. the standard deviation that appears in the table prior to the test. Does anyone have any ideas as to how I can extract the (SD) statistic from the mi testtransform table into a matrix or failing that another approach to this problem. My only option at the moment is to extract all 150 values manually.

    Thanks!

  • #2
    my apologies. I have solved this myself. I discovered the output I want is saved in e(b_Q_mi). Maybe this will be helpful to others.

    Comment

    Working...
    X