Announcement

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

  • Calculating adjusted risk ratio with weight for a multilevel variable

    Hi all,

    I am trying to calculate adjusted risk ratio using the adjrr command. For 2 level variables, it is straightforward. However, I am trying to weight (establish a baseline) for each of the multilevel variables in my data set. Thanks for the help in advance

    Here is my code thus far
    Code:
    tab age_cat primary_reop, chi exact nolog row
    binreg primary_reop b1.age_cat, rr
    logit primary_reop b1.age_cat
    adjrr age_cat, at(age_cat==1)
    With a copy of my data

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(primary_reop age_cat)
    0 1
    0 2
    0 1
    0 1
    0 2
    0 1
    0 2
    0 3
    0 2
    0 1
    0 3
    0 1
    0 2
    1 1
    0 1
    0 1
    1 2
    0 1
    1 1
    0 2
    0 1
    0 3
    1 1
    0 1
    1 2
    0 1
    0 1
    1 1
    0 1
    0 2
    0 2
    0 2
    0 2
    1 2
    0 1
    0 1
    0 3
    1 1
    0 3
    1 2
    0 2
    0 1
    0 1
    0 2
    0 1
    0 2
    0 1
    0 1
    0 1
    0 2
    0 1
    0 1
    1 1
    1 1
    0 1
    1 1
    0 1
    0 1
    0 2
    0 2
    1 2
    0 1
    0 1
    0 2
    0 1
    0 2
    0 1
    0 1
    0 1
    0 1
    0 2
    0 2
    0 1
    0 3
    0 2
    1 3
    0 3
    1 2
    1 1
    0 2
    0 1
    0 2
    0 1
    0 2
    0 2
    0 2
    0 1
    0 1
    0 1
    1 1
    0 2
    0 1
    0 1
    0 1
    0 1
    0 2
    1 1
    0 2
    0 2
    1 1
    end

  • #2
    Additionally, my issue is that the above code is not working for weighting by multilevel variables. It works fine for 2 level variables.

    Comment


    • #3
      Bump, please assist if you are willing or let me know if you need clarification of the problem.

      Comment


      • #4
        Yes, this needs a lot of clarification. You speak of 2- and multi-level variables. Do you mean dichotomous and polytomous variables? Or do you have some kind of 2- or multi-level model in mind? If so, which variables are at which levels and how do they nest/cross?

        You refer to a command -adjrr- which is not part of official Stata. Where does it come from? What does it do? You show code for -binreg- and a -logistic- model. And what is their relevance to your problem? Are you trying to choose between these two models somehow? Are they giving you results you didn't expect? Do you want to modify them in some way? Do their results feed into -adjrr- in some way?

        You say "I am trying to weight (establish a baseline) for each of the multilevel variables in my data set." But weighting is different from anything that might be called establishing a baseline. And what do you mean by "establishing" a baseline for a variable? And in what sense of the word are you using "baseline."

        You say "my issue is that the above code is not working for weighting by multilevel variables." Well, the only thing that "is not working" can tell us is that some results, left entirely to the imagination, differ from your expectations, also left entirely to the imagination.

        I suggest you start over. Use terminology carefully and unambiguously. Explain clearly what kind of results you want to get. Show the undesired results you have gotten and, if it isn't immediately obvious, explain how they differ from what you wanted.

        Comment

        Working...
        X