Announcement

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

  • Nested Logistic Regression resulted in an error

    Hello, everyone. I am currently utilizing GSHS Malaysia 2012 dataset and wanted to understand associated factors of overweight/obese (1= overweight/obese; 0= normal BMI)
    I applied survey dataset:

    [CODE]
    egen mean_w=mean(weight)
    gen wt=weight/mean_w
    svyset psu [pw=wt], strata(stratum) vce(linearized) singleunit(centered)
    /CODE]

    And then running the nested regression:
    • Block 1 including sociodemographic status (age, sex, form)
    • Block 2 including food diets (fruit, veggie)
    • Block 3 including physical activities (aktivitas fisik, olahraga, bike)
    • Block 4 including all covariates
    Code:
     nestreg: svy: logistic dependent (i.age i.sex i.form) (i.fruit i.veggie) (i.aktivitas_fisik i.olahraga i.bike) (i.age i.sex i.form i.aktivitas_fisik i.olahraga i.bike), base
    Codes were running perfectly fine except for the last block (Block 4) where it stated:

    Code:
    note: 0.age omitted because of estimability.
    note: 0.sex omitted because of estimability.
    note: 0.form omitted because of estimability.
    note: 0.fruit omitted because of estimability.
    note: 0.veggie omitted because of estimability.
    note: 0.aktivitas_fisik omitted because of estimability.
    note: 0.olahraga omitted because of estimability.
    note: 0.bike omitted because of estimability.
    note: 1.age omitted because of estimability.
    note: 1.sex omitted because of estimability.
    note: 1.form omitted because of estimability.
    note: 2.form omitted because of estimability.
    note: 3.form omitted because of estimability.
    note: 4.form omitted because of estimability.
    note: 1.aktivitas_fisik omitted because of estimability.
    note: 1.olahraga omitted because of estimability.
    note: 1.bike omitted because of estimability.
    Unfortunately, when I tried to run the last block separately (not using nestreg, it appeared to be):
    Code:
     svy: logistic dependent i.age i.sex i.form i.aktivitas_fisik i.olahraga i.bike i.fruit i.veggie, base
    It ran perfectly just fine


    So i wonder where my code went wrong?

    Many thanks.

  • #2
    You’ve already got all the vars by block 3. In block 4 you are basically adding every variable a second time. Just stop at block 3 and you are fine.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 18.5 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      Dear Richard Williams, many thanks! My bad, I thought that nested regression does not work that way.

      Also, may I follow up with another question:
      If, GSHS, did a sample selection process using double stage: 1) selecting school; 2) selecting class, should I employ multilevel regression? But I suppose that multilevel regression is not available using nestreg? In addition, if the GSHS 2012 did not provide the school and class id, could I use PSU instead to substitute them?

      Many thanks.

      Comment

      Working...
      X