Announcement

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

  • #46
    I certainly appreciate all the guidance. We have spoken about how the estimates are on the additive scale and if we want to have the effect of x over 5 years for example we add the estimates together, but how do we handle to p value/CI?

    Comment


    • #47
      Do the addition using the -lincom- command. For example
      Code:
      lincom _b[x] + _b[5.time]
      will give you the combined effect of a unit change in x and the passage of time from 0 to 5, along with standard error, confidence interval, and test statistics.

      Comment


      • #48
        Great! One thing that has come up in discussion is this unit change in x, or x=0 to x=1. If in our data nobody actually has an x of 1 (range is 0.01 - 0.75) how is the B estimate calculated?

        Comment


        • #49
          Do you really want to know how it is calculated? Or do you want to know what it means?

          It is calculated the same way any linear regression coefficient is calculated. I would refer you to any standard statistics textbook that covers linear regression. I suspect you really don't care that much about this.

          As for what it means, remember that in a linear regression model, you are assuming that the relationship between y and x is linear, plus an error term. The value of the coefficient is then the slope of the line that fits the data best, in the sense of minimizing total squared error. How is that interpreted? If x were a dichotomous 0/1 variable, it would actually equal the expected difference between y when x = 1 and when x = 0. But with a continuous variable, one that perhaps never reaches one, its meaning is somewhat different. Think about driving in a car at a constant speed of, say, 30 mph. You could plot a graph of the distance traveled (y in miles) vs. time driven (x in hours), and that graph would be a straight line with slope 30. So that slope is your rate of progress, your speed. Even if you actually only drove for half an hour, it would still be meaningful to speak of your speed as being 30 miles per hour. So the same is true in your regression model. It is the rate of change in y per unit change in x--which is meaningful even if a full unit change in x never happens.

          Comment


          • #50
            That is a very helpful description thank you. One thing I would add is that the command
            Code:
            lincom _b[x] + _b[5.time]
            does not work after this estimation command
            Code:
            mi estimate: xtreg y_FGF23 x bmi_BL i.education_level_bl s25OHD_2012_bl i.smoke_status_BL i.time if frailty_up_down ==1, i(Patient_ID) fe
            requested action not valid after most recent estimation command

            Comment


            • #51
              Oh, I forgot about the use of multiple imputation. You can't use -lincom- after -mi estimate-. You have to use -mi test-, or, more specifically in your case, -mi testtransform-. This is somewhat complicated. Do read the PDF documentation for -mi test-, and pay particular attention to the example on Testing linear hypotheses, to see how it is done.

              Comment


              • #52
                Hi, all. In a prospective cohort study, we want to analyse the association between meat consumption and renal function over 2 years of follow-up. We have analysed meat at baseline and we have multiple measurements of glomerular filtration over time (at baseline, one year and 2 years). We have run a linear mixed model using the mixed command in STATA 15. Participants (id) were treated as random intercepts in the models and each visit (baseline, one-year, and 2-years) as a random slope. Our hypothesis is that higher meat consumption is detrimental to renal function. I would like some help in interpreting the results.

                Independent variable--> meat_cat = categories of meat consumption at baseline. low = 0 and high = 1
                Dependent variable: eGFR = Glomerular filtration rate in mL/min/m2
                Time variable: visit = at baseline, 1 year and 2 years
                Covariables (time-invariant) for adjustment:
                sex: 0 = males, 1 = females
                BMI: kg/m2
                smoking: 1= never, 2 = current, 3 = former
                educat: educational level: 1 = elementary school, 2 = high school, 3 = university
                alcohol: tertiles of alcohol consumption in g/day


                Following you can see our code:
                Code:
                reshape long eGFR, i(id) j(visit)
                
                mixed eGFR i.meat_cat age i.sex BMI i.smoking i.educat i.alcohol i.visit i.meat_cat#i.visit || id: visit
                
                ----------------------------------------------------------------------------------------------------------------------
                                                                     Robust
                            eGFR_EPI_cyc       Coef.        Std. Err.      z             P>|z|     [95% Conf. Interval]
                -------------------------+--------------------------------------------------------------------------------------------
                         1.meat_ca              -1.644824   .8390989    -1.96   0.050    -3.289428   -.0002207
                                age              -1.210029   .0770964   -15.70   0.000    -1.361136   -1.058923
                                sex
                                  women          -1.868799    .942676    -1.98   0.047     -3.71641   -.0211885
                                BMI              -.4442839   .1083105    -4.10   0.000    -.6565685   -.2319993
                                smoking
                                      2           6.564969   1.179859     5.56   0.000     4.252487     8.87745
                                      3           7.577103    1.26238     6.00   0.000     5.102883    10.05132
                                educat
                                      2           .4152159   .8539321     0.49   0.627     -1.25846    2.088892
                                      3          -.4455125   .9842596    -0.45   0.651    -2.374626    1.483601
                               alcohol
                                      2           1.076502   .9089594     1.18   0.236    -.7050256     2.85803
                                      3           2.562291     1.0451     2.45   0.014     .5139328     4.61065
                               visit 
                                      1           -1.657894   .4172987    -3.97   0.000    -2.475785   -.8400039
                                      2           -5.382031   .4563646   -11.79   0.000    -6.276489   -4.487573
                               meat_cat#visit 
                                    1 1            -.4348857   .5839773    -0.74   0.456     -1.57946    .7096889
                                    1 2            -.0330323   .6430869    -0.05   0.959    -1.293459    1.227395
                                   _cons          160.9187   7.001806    22.98   0.000     147.1954    174.6419
                ----------------------------------------------------------------------------------------------------------------------
                
                ----------------------------------------------------------------------------------------------------------
                                                                  |               Robust           
                  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
                -----------------------------+----------------------------------------------------------------------------
                paciente: Independent              |
                                 var(visits)                 |   3.742968   1.751322      1.496035    9.364627
                                  var(_cons)              |   196.9329   7.491222      182.7844    212.1766
                -----------------------------+----------------------------------------------------------------------------
                               var(Residual)             |   64.77076   3.180251      58.82811    71.31372
                ----------------------------------------------------------------------------------------------------------
                
                
                contrast [email protected]_cat, effect
                
                
                Contrasts of marginal linear predictions
                
                Margins      : asbalanced
                
                ----------------------------------------------------------------------
                                              df      chi2     P>chi2
                ---------------------+------------------------------------------------
                eGFR                 
                visit@meat_cat  
                                  0   2      151.06     0.0000
                                  1   2      144.28     0.0000
                              Joint   4      290.36     0.0000
                ----------------------------------------------------------------------
                
                ----------------------------------------------------------------------------------------------------------
                                             Contrast      Std. Err.      z     P>|z|     [95% Conf. Interval]
                ---------------------+------------------------------------------------------------------------------------
                eGFR                          
                visit@meat_cat
                      (1 vs base) 0         |  -1.657894   .4172987    -3.97   0.000    -2.475785   -.8400039
                      (1 vs base) 1         |  -2.09278     .4108425    -5.09   0.000    -2.898017   -1.287544
                      (2 vs base) 0         |  -5.382031   .4563646   -11.79   0.000    -6.276489   -4.487573
                      (2 vs base) 1         |  -5.415063   .4610206   -11.75   0.000    -6.318647    -4.51148
                ----------------------------------------------------------------------------------------------------------
                
                
                
                contrast i.visit#i.meat_cat, effect
                
                Contrasts of marginal linear predictions
                
                Margins      : asbalanced
                
                --------------------------------------------------------
                                  df      chi2     P>chi2
                ---------------------+----------------------------------
                eGFR                
                visit#meat_cat    2        0.78     0.6759
                --------------------------------------------------------
                
                ------------------------------------------------------------------------------------------
                                                 Contrast      Std. Err.      z    P>|z|     [95% Conf. Interval]
                -------------------------+----------------------------------------------------------------
                eGFR              |
                    visit#meat_cat |
                (1 vs base) (1 vs base)        |  -.4348857   .5839773    -0.74   0.456     -1.57946    .7096889
                (2 vs base) (1 vs base)        |  -.0330323   .6430869    -0.05   0.959    -1.293459    1.227395
                ------------------------------------------------------------------------------------------

                According to the output, our interpretation was the following: In the fully adjusted model, compared to participants with the lowest consumption of meat, those with the highest consumption presented lower values of eGFR over 2 years of follow-up (β: -1.644824 ml/min/1.73m2; 95% CI: -3.289428 to -.0002207).

                However, we have been told that this interpretation is incorrect, and this beta and 95%CI correspond to time 0 (baseline). Moreover, the same person has proposed presenting the results by each year instead, which I understand are those obtained after running:
                Code:
                [email protected]_cat, effect
                We would like to know if someone can help us with the interpretation of the results and confirm if the beta and 95%CI of our exposure can be interpreted in this way or, in fact, we must present the results for each year.

                Many thanks in advance.

                Nerea

                Comment


                • #53
                  Well, actually, your model is incorrectly specified, so it should not be interpreted at all. You have i.visit as a (fixed) effect in the lowest level of the model. But then you have included a random slope for visit as a continuous variable. This is not permissible. You have to make a decision whether you want visit to be modeled as a discrete variable (which basically imposes no constraints on the movements of egfr from visit to visit) or as a continuous variable, which constrains the trajectories of egfr over time to be straight lines. Whichever you chose, you have to use it the same way in both levels of the model. So either -mixed egfr ... i.visit ... i.meat_cat#i.visit || id: i.visit- or -mixed egfr ... visit i.meat_cat# c.visit || id: visit-. But you can't mix them.

                  That said, and either way, the person who advised you about the interpretation is correct. You have an interaction between meat category and visit in your model, so the coefficient of 1.meat_cat is only interpretable as the expected difference in egfr at baseline between high and low meat consumers. If you stick with visit as discrete, then you will indeed need to also look at the differences in egfr at visits 1 and 2 between high and low meat consumers. If you change visit to continuous, you would probably be more interested in the contrast in slopes of egfr as a function of visit between high and low meat consumers. The regression coefficient 1.meat_cat#visit will give you that.

                  Note: Until fairly recently, Stata did not support factor variable notation in random effects, so -mixed egfr ... i.visit ... i.meat_cat#i.visit || id: i.visit- may not be possible, depending on your version of Stata. It certainly is OK in the current version (17). I don't remember if it was supported in version 16. I'm pretty sure it was not supported in version 15 or earlier. If your version does not support factor variable notation in random slopes, this would be the time to drag out the dusty old -xi:- command prefix.

                  Comment


                  • #54
                    Many thanks for your comment, Clyde, and for spotting the mistake in the code.
                    You are right and STATA 15 does not support factor variable notation in random effects. We will have to use the -xi:- command.
                    If I may, I would like to ask another question about mixed models for longitudinal repeated measurements.
                    Do we always have to introduce the interaction between the exposure variable and time in our model? How would we interpret the results without including the interaction with time?

                    Comment


                    • #55
                      If you do not include the interaction, then your model stipulates that there is some expected difference in egfr between high and low meat consumers, and that this difference does not change over time.

                      You have to consider the underlying nephrology, about which I am not an expert, to decide between the models. From the perspective of study design, if you are starting with cohorts of high and low meat consumers, who have been that way for a long enough time to reach equillibrium (in terms of egfr), and if you believe that the meat consumption has, from that point no further influence on the trend/trajectory of egfr in the future, then it is reasonable to omit the interaction term. But if you think that there will be a continuing effect of meat consumption on egfr so that the difference between the high and low meat consumers will change, then the interaction term is required.

                      Comment


                      • #56
                        Thanks for the explanation, Clyde!

                        Comment


                        • #57
                          Dear Clyde thinking about the xtreg command we have been using with fe, upon review I have been requested to include a couple of things and I wondered your opinion.
                          1. Was the repeated or random statement used, or both?
                          My response would be that we used fixed effects.
                          2. Please include the AIC values.
                          From what I have read it is not possible to calculate AIC values from the xtreg command that we used. Is this correct or is there some other way of doing it?

                          Your thoughts here would be very helpful.

                          Comment


                          • #58
                            re: your second question, the following is from the help file: "estat ic and lrtest are not appropriate after xtreg with the pa or re option." - it appears that you did not use either option so, yes, it is available to you; the general rule on finding what post-estimation commands to use, with the specific example here of -xtreg-, is:
                            Code:
                            h xtreg
                            
                            click on "also see" at the top of the help file
                            
                            click on "xtreg postestimation"
                            
                            and see what is there
                            in this case you will find "estat ic" which will give you what is requested

                            Comment


                            • #59
                              1. Was the repeated or random statement used, or both?
                              My response would be that we used fixed effects.
                              I don't understand this question. There is no "repeated or random statement" in Stata. I think whoever is asking this question has some other statistics package in mind, and while I might speculate what this might means, I don't really know.

                              Your response that you used fixed effects will be accurate, but, I suspect, will not answer the intent of the question. I think you need to get clarification of what the person who posed this question has in mind.

                              Comment


                              • #60
                                Thank you Clyde. Am I also correct in saying it is not possible to get AIC values from xtreg, I have used the estat IC command as suggest above by Rich but I still get the error "likelihood information not found in last estimation results". I have tried to use a glm command which does give me AIC values but of course that is a different model to the xtreg.

                                Comment

                                Working...
                                X