Announcement

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

  • Error code: all observations in subpop() subpopulation have zero weights r(461) - for MEPS data.

    Hi all,

    I am using STATA to analyze data from MEPS (medical expenditure survey panel), which is (as listed on the website) "a set of large-scale surveys of families and individuals, their medical providers (doctors, hospitals, pharmacies, etc.), and employers across the United States. MEPS collects data on the specific health services that Americans use, how frequently they use them, the cost of these services, and how they are paid for, as well as data on the cost, scope, and breadth of health insurance held by and available to U.S. workers."

    I am studying patients with a specific disease population and have already created my files for my population of interest (patients with atopic dermatitis who have skin infections) and control population (patients with atopic dermatitis without skin infections). I am specifically looking at the expenditures of my population of interest and comparing them to my control population.
    I am looking all the data from 1996-2015 (so each years data must be analyzed separately).

    When running my codes for expenditure data, I have to combine a "full year consolidated file" (contains the expenditure variables for every medical condition) and the population file I created for the atopic dermatitis (AD) patients with skin infections. I do this via "form all pairwise combinations within groups," giving me the file with the expenditures for my specific population of interest (atopic dermatitis with skin infections).

    Then, I establish the variables so that I can calculate expenditures for each type of service visit (inpatient, ambulatory (made up of outpatient variables), emergency, prescribed medicines etc). It is when calculating the means for the expenses for some visits for certain years that I get this error message: all observations in subpop() subpopulation have zero weights
    r(461);.


    STATA help feature states that the issue is the following: " code 461. fpc for all observations within a stratum must be the same;There is a problem with your fpc variable; see [SVY] svyset."

    I am not sure how to edit the coding in my svyset data code to account for the fpc.

    I have listed my exact coding below, if anyone has any idea of how to resolve this issue please let me know as I have an upcoming deadline for my data. I am pretty new to STATA and using the STATA with MEPS for the first time, so any help is appreciated.
    ________________________________________________
    import sasxport "h121.ssp"

    . destring dupersid, replace
    dupersid has all characters numeric; replaced as long

    . save "/Users/jeenasandhu/Desktop/2008 full year file.dta"
    file /Users/jeenasandhu/Desktop/2008 full year file.dta saved

    . joinby dupersid using "/Users/jeenasandhu/Desktop/2008 AD with skin infxns.dta", unmatched(none)

    . gen total=totexp08

    . gen hospital_inpatient = ipdexp08 + ipfexp08

    . gen ambulatory = obvexp08 + opdexp08 + opfexp08

    . gen emergency = erdexp08 + erfexp08

    . gen prescribed_medicines = rxexp08

    . foreach var in total hospital_inpatient ambulatory emergency prescribed_medicines {
    2. gen x_`var'=(`var'>0)
    3. }

    . svyset [pweight= perwt08f], strata( varstr) psu(varpsu) vce(linearized) singleunit(certainty)

    pweight: perwt08f
    VCE: linearized
    Single unit: certainty
    Strata 1: varstr
    SU 1: varpsu
    FPC 1: <zero>

    . svy, subpop(x_total): mean total
    (running mean on estimation sample)
    all observations in subpop() subpopulation have zero weights
    r(461);


    . svy, subpop(x_ambulatory): mean ambulatory
    (running mean on estimation sample)
    all observations in subpop() subpopulation have zero weights
    r(461);


    etc.
    _________________________________________

    Thank you.

  • #2
    It's been a while since I worked with any sort of -svyset- data (although the last time I did it was on MEPS). I don't recall all the ins and outs. Your commands themselves look correct, but I would double check (unless you already did so) that if you ran the code on H121 without joining your additional file, that the subpopulation estimate works. Then, does any estimation command work on the merged file without the subpop option?

    From there, my main suspicion would be that your 2008 AD file doesn't have the svy data, so some people lack weights. I am unfamiliar with -joinby-, but you said (and the manual confirms) that it creates all pairwise combinations of, in your case, the unique identifier dupersid. It looks like unmatched observations get dropped entirely. Is that correct? I'm not sure that's what you want to do. Or, if not that, then something during the merge eliminated the weights.

    You didn't describe what the 2008 AD file is, but I assume you did something like parse the file describing medical encounters for ICD-9 codes describing atopic dermatitis. I am guessing you want to transfer flags from there to the full-year file. It may work if you merge instead; you can use the -keepusing- option to specify just your flag (and anything else you want from that file).
    Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

    When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

    Comment


    • #3
      Thank you for your response! I looked at the individual weights for the patients, and it turns out that some of the patients lack weights (since the original file, not post merging). I am planning on reporting weighed data, so it may just be that I will have to exclude these particular patients.
      Last edited by Jeena Sandhu; 22 Dec 2017, 13:08.

      Comment


      • #4
        Originally posted by Jeena Sandhu View Post
        Thank you for your response! I looked at the individual weights for the patients, and it turns out that some of the patients lack weights (since the original file, not post merging). I am planning on reporting weighed data, so it may just be that I will have to exclude these particular patients.
        Zero weight for some people in the original file sounds a bit odd but plausible (maybe they entered a nursing home - this US survey is representative of the civilian non-institutionalized population). Zero weight for all with total medical expenditures over zero (if I read your code correctly) sounds like an error. The error code you gave says that the entire subpopulation had zero weights. Something else may be wrong.
        Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

        When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

        Comment


        • #5
          As Jeena found, error 461 appears with the zero weights message but is associated with an fpc error in the Manual. I've reported the discrepancy to Technical Support. I'll also point out (though probably irrelevant to the overall problem of zero weights) that:

          1. Statements like:
          Code:
          gen ambulatory = obvexp08 + opdexp08 + opfexp08
          will result in a missing value if any of the components is missing. The solution is
          Code:
          egen ambulatory = rowtotal(obvexp08  opdexp08 opfexp08)
          2. If a variable is missing, the following syntax will assign the person to the associated subpopulation of "positive" values..
          Code:
           gen x_`var'=(`var'>0)
          Instead use
          Code:
           gen x_`var'=(`var'>0) & `var'< .
          Jeena, in future posts, please use CODE delimiters to show all code and output. These are, described in FAQ 12.
          Last edited by Steve Samuels; 25 Dec 2017, 10:05.
          Steve Samuels
          Statistical Consulting
          [email protected]

          Stata 14.2

          Comment

          Working...
          X