Announcement

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

  • "by" and missingness in table1_mc

    Hi

    I have two queries relating to the use of table1_mc:

    1)

    I would like to create a table1 describing rates of cardiac interventions (ECHO, angiography, PCI, CABG) stratified by both stage of chronic kidney disease (ckd_stage) and heart attack type (acuteMI_type). My current attempt is below, but STATA reports that I am specifying too many variables within my "by" command (r103). Is there a way to get around this?

    table1_mc, by(ckd_stage acuteMI_type) vars(echo bin %4.0f\ angiogram bin %4.0f\ pci bin %4.0f\ cabg bin %4.0f) nospace onecol missing test saving("table 3.xlsx", replace)

    2) I have also tried to generate a column for overall missingness of each variable (see code above) but I don't seem to get a result for this. Could someone possibly suggest where I'm going wrong?

    Thankyou

  • #2
    I do not use table1_mc which is not an official command. In any case, for #1, you can use the -group- function of egen to combine variables, then use this variable within -by()-.

    Code:
    egen byvar= group(ckd_stage acuteMI_type), label
    table1_mc, by(byvar)

    Comment


    • #3
      Thanks so much for replying - I'll try this today.

      Comment

      Working...
      X