Announcement

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

  • About clogit in interventional study

    Hello. I would like to ask your help about clogit.
    Interventional study was conducted, the data was like as below.

    no, age, sex, i.group, pre/post, hypertension
    1, 24, F, inter, pre, yes
    2, 30, m, control, pre, no
    3, 38, f, inter, pre, no

    1, 24, F, inter, post, no
    2, 30, m, control, post, no
    3, 38, f, inter, post,no

    I would like to conduct clogit for hypertension presence as binary outcome.

    clogit HT age sex i.group, group(no)

    But the result was error as below.
    --------
    . clogit HT age sex education i.group_co, group(no)
    note: multiple positive outcomes within groups encountered.
    note: 440 groups (880 obs) dropped because of all positive or
    all negative outcomes.
    note: age omitted because of no within-group variance.
    note: sex omitted because of no within-group variance.
    note: education omitted because of no within-group variance.
    note: 2.group_co omitted because of no within-group variance.
    note: 3.group_co omitted because of no within-group variance.

    redundant or inconsistent constraints
    -----------

    Where was the wrong?
    I'm looking forward to your support.
    Regards,


  • #2
    note: multiple positive outcomes within groups encountered.
    This is just for your information. It is not a problem. If it bothers you to see it, use -xtreg, fe- instead of -clogit- and it won't complain about this. It's just that customarily -clogit- is used in a situation where there is a single positive outcome within each observation group.

    note: 440 groups (880 obs) dropped because of all positive or
    all negative outcomes.
    You will encounter this in any kind of matched-pair analysis. Only those pairs where the outcome changes are informative in these analyses. So again, this is just for your information. If you think that there shouldn't actually be 440 people where htn didn't change between pre and post, then you should check your data set and review the data management that created it to figure out what went wrong. But if it is reasonable that there are 440 people whose htn didn't change, then, again, this is not an issue.

    note: age omitted because of no within-group variance.
    note: sex omitted because of no within-group variance.
    note: education omitted because of no within-group variance.
    Again, this is just information for you; there is nothing wrong here. Except perhaps your surprise at this happening. Each person's age, sex, and education remained the same between pre- and post assessments. That's not surprising. (Well, age not changing could be surprising if the follow-up interval was long--in that case, again, something is wrong with your data, not the code.) It is a general principle that in fixed-effects models (and -clogit- is a fixed-effect logistic regression), any variable that does not vary within panel (group(no) in your case) is necessarily colinear with the fixed effects and must be omitted. It is mathematically impossible to assess these time-invariant effects in a fixed-effects model.

    note: 2.group_co omitted because of no within-group variance.
    note: 3.group_co omitted because of no within-group variance.
    OK, these surprise me. They surprise me mostly because there is no mention in your data description, nor your code, of any group_co variable, just group. On the assumption that there really is no variable named group, it is really group_co, I'm somewhat surprised to see 2. and 3. referred to because it appears from your data listing that you have only two groups, inter and control, and normally these would be coded as 0 and 1, or perhaps 1 and 2. Then again, assuming still that group_co is the correct name of the variable you have called group, it, too, does not change between pre- and post: this was not a crossover design. So, just as with sex and education, it is time-invariant and it is mathematically impossible to assess its effects in a fixed-effects model. Since your data listing is a highly incomplete description of your data set, I can't say anything more specific. The most helpful way to show example data on this Forum is by using the -dataex- command. If you are running version 17, 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

    So if you can't figure this last pair of messages out, then you definitely need to use the -dataex- command to actually show the data and metadata needed to resolve it when you post back.

    When asking for help with code, always show example data. When showing example data, always use -dataex-.
    Last edited by Clyde Schechter; 23 Dec 2022, 20:13.

    Comment


    • #3
      Dear Dr Schechter

      Thank you very much for your kind response and very helpful information.
      I would like to ask you how I conduct clogit for binary hypertension outcome,
      for identifying the difference pre-post intervention results among control vs intervention groups.

      clogit HT, group(no)
      clogit HT age sex education coho1, group(prepos)

      Could you kindly check below code?

      [CODE]
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input float HT byte(age sex education) int no float coho1 byte prepos
      0 52 0 0 1 1 1
      1 58 0 5 2 1 1
      1 53 1 5 3 1 1
      1 55 0 11 4 1 1
      0 53 0 5 5 1 1
      1 65 0 5 6 1 1
      1 54 0 5 7 1 1
      0 48 0 11 8 1 1

      I'm looking forward to hearing from you.
      Best regards,



      Comment


      • #4
        In the example data you show, no such analysis is possible because each group (defined by the value of no) has only a single observation, and hence there is no within-group variation in anything. And you also only present observations with coho1 = 1 and prepos = 1, so you don't even have observations representing all the combinations of intervention vs control and pre vs post. Presumably in your real data set, however, you do not have these limitations.

        To look for an effect of the intervention on blood pressure in this matched pair design, you must do a difference-in-differences analysis. This entails using an interaction between treatment assignment and pre-post and estimating the effect from the interaction coefficient. So the code you want is:
        Code:
        xtset no prepos
        xtlogit HT i.coho1##i.prepos, fe
        The coefficient of 1.coho1#1.prepos is the difference-in-differences estimate of the intervention effect of the prevalence of hypertension. Its standard error, confidence intervals and test statistics can be used to express the sampling variation induced uncertainty in the usual way.

        I am using -xtlogit, fe- instead of -clogit-, just out of habit. They do the same thing, they just have different syntax, and I prefer -xtlogit, fe-.

        Note that I do not include the age, sex, and education variables because we have already noted that these don't vary within person, and so their effects are extinguished by the matched-pair design. If you try to include them, Stata will omit them for you anyway. (Note: if the follow-up period is long enough, then age, and, less likely, education, might actually vary within person. If they do that in your full data set, you could, in principle, include them. But trials of treatments for hypertension are usually of pretty short duration, so I suspect that at most a small number of people will exhibit changes in these variables. Consequently your estimates of their effects will have very wide margins of error.)

        Comment


        • #5
          Dear Dr Schechter

          Thank you very much for your kind guidance and great suggestion..
          I will report the result of "coho1#prepos" as effectiveness of intervention.

          In actual data, we have 3 group as intervention1, intervention2, and control (I will call this as cohort2).
          Could I include cohort2 instead of cohort1?

          I'm looking forward to hearing from you.
          Best regards,

          Comment


          • #6
            Yes. In fact, you don't have to change the code. If you have a single variable coho1 which represents all three groups with separate numbers (e.g. 0, 1, 2) the code will automatically take all three groups into account.

            What will change is the interpretation. There will be two interaction terms in the output: 1.coho1#1.prepos and 2.coho1#2.prepos. So you will have two difference in difference estimates. One of them represents the estimated effect of intervention in cohort 1 compared to cohort 0, and the other the estimated effect of intervention in cohort 2 compared to cohort 0. If you are also interested in the intervention effect in cohort 2 compared to cohort 1, you just need to subtract those. (Use -lincom 2.coho1#1.prepos - 1.coho1#1.prepos-). And if you are no longer interested in the cohort 1 findings, you can just ignore them.

            If you wish to do an analysis that uses cohort2 instead of cohort 1in the first place just add -if inlist(coho1, 0, 2)- to the -xtlogit- command (before the comma).

            By the way, if you want your output in terms of odds ratios instead of logistic regression coefficients, you can add the -or- option to both the -xtlogit- command and the-lincom- command.

            Comment


            • #7
              Dear Dr Schechter

              Thank you very much for your great advise.
              I could conduct the analysis with satisfactory.
              I appreciate you and your constructive guidance.
              I look forward to your further support.
              Best regards,

              Yuri

              Comment

              Working...
              X