Announcement

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

  • Subgroup Analysis

    I was using a skeleton code I was given and need some help changing it to fit my dataset variables. The code doesn't run, please could someone help identify the problem

    stset person_years, failure(Comp_outcome) id(practice_patient_id)

    stcox exposed ETHNICITY_NEW e2019_imd_5 BMI_category SMOKINGSTATUS_CATEGORY N_statin N_insulin N_hypertensive N_othermedication if BMI35==1

    stcox exposed ETHNICITY_NEW e2019_imd_5 BMI_category SMOKINGSTATUS_CATEGORY N_statin N_insulin N_hypertensive N_othermedication if BMI35==2

    testparm BMI35*

  • #2
    it would help if you could provide some idea of how far the code gets before it stops and what Stata tells you at that point (e.g., an error code/message); the FAQ has valuable advice on how to ask questions that can be answered

    depending on the message you may also need to provide a -dataex- data example (within CODE blocks please)

    Comment


    • #3
      The final line of code in which I attempt to test the interaction between each subgroup is where the following error code appears - "the specified varlist does not identify any testable coefficients" Rich Goldstein

      Comment


      • #4
        Originally posted by Caitlin Smith View Post
        stset person_years, failure(Comp_outcome) id(practice_patient_id)

        stcox exposed ETHNICITY_NEW e2019_imd_5 BMI_category SMOKINGSTATUS_CATEGORY N_statin N_insulin N_hypertensive N_othermedication if BMI35==1

        stcox exposed ETHNICITY_NEW e2019_imd_5 BMI_category SMOKINGSTATUS_CATEGORY N_statin N_insulin N_hypertensive N_othermedication if BMI35==2

        testparm BMI35*
        You can test hypotheses involving estimated coefficients, and there are no coefficients prefixed "BMI35" in your estimates. The variable "BMI35" is your grouping variable, so the error message is informative.

        the specified varlist does not identify any testable coefficients
        Last edited by Andrew Musau; 16 Jul 2023, 18:03.

        Comment


        • #5
          you can use -suest- if I understand you correctly; see
          Code:
          h suest

          Comment

          Working...
          X