Announcement

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

  • Weights and reference category

    Hi everyone,
    I have two questions:
    1) If I'm running an xtlogit model how can I set a reference category as the default one with OR=1?
    For example, if I have var: "risk" with "low, medium and high" categories how can I give OR=1 to the medium one?
    I tried
    Code:
    char risk[omit] 2
    but it does not work

    2) Can I use the standard deviation for a tab with analytic weight? [aweight=...]
    What is the difference with default standard deviation?


    Thanks a lot! Have a nice day!

  • #2
    I think you are relying on the now superseded -xi- for dealing with factor variables. Move up to Stata's factor variables. See -help fvvarlist- for details.

    As to your specific question, you don't tell us how risk is actually encoded, though given what you tried with -char risk[omit] 2-, I'm guessing that medium = 2. So to have that as the reference category in an estimation involving the risk variable, use ib2.risk to represent risk in the model. E.g. -logit outcome ib2.risk-.

    If you plan to do many analyses and you want to have 2 as the reference category for risk in all of them, and you don't want to retype ib2.risk all the time, then before you start the analyses, try -fvset base 2 risk- first.

    Comment


    • #3
      By the way, if you really want to make 2 the reference category for risk "permanently," after -fvset base 2 risk-, if you save the data set, that setting will be remembered and used thereafter in any analyses involving that data set (until you explicitly unset it or override it.)

      Comment


      • #4
        Thanks a lot! It worked. Do you have any idea about the weights? Do I need to give further information?

        Comment


        • #5
          Actually, I don't understand the question about "standard deviation for a tab with analytic weights." Why don't you post the command you would like to run, and somebody can comment on it. Actually, just try it yourself first and see if it gets you what you want. If it doesn't, or if it won't run, post it and maybe somebody can figure out what you mean to do and how to get it done.

          Comment


          • #6
            Yes. I tried
            if I run
            Code:
            mean var1
            I receive
            Code:
            --------------------------------------------------------------
                         |       Mean   Std. Err.     [95% Conf. Interval]
            -------------+------------------------------------------------
                 var1 |    2.88003   .0218486      2.837207    2.922854
            if I run
            Code:
            mean var1 [aw=w1]
            I receive
            Code:
            --------------------------------------------------------------
                         |       Mean   Std. Err.     [95% Conf. Interval]
            -------------+------------------------------------------------
                 var1 |   2.827591    .020898       2.78663    2.868551
            Which std. err. should I consider? Always the one with weights?

            Thanks!

            Comment


            • #7
              Either could be appropriate depending on the source of your data and what your research question is. You really need to tell us a lot more about what your doing and why here.

              Comment

              Working...
              X