Announcement

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

  • #61
    You can get AIC and BIC after -xtreg, fe-. But not after -xtreg, re-. If you need an AIC or BIC after a random effects linear model, use -mixed- instead of -xtreg, re-, and then you can get the information criteria from -estat ic-.

    Comment


    • #62
      I am unable using the following 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
      estat ic
      I still get the error
      "likelihood information not found in last estimation results"

      Comment


      • #63
        I'm sorry, you didn't make clear that you are using -mi estimate-. There is no official Stata command for AIC/BIC after -mi estimate-. I'm not aware of any user-written one either. In fact, given that the final estimates of -mi estimate- are not derived by maximum likelihood (even if the command that -mi estimate- is prefixed to does), I don't even think it is conceptually possible.

        Comment


        • #64
          Dear Clyde, a further question on review of this paper and using the code we have which I include below has been, What covariance matrix structure did you choose and why? I have tried to read into this and I assume we would use the e(V) command in stata to get the covariance matrix but I am still unsure on how to answer that question. Would you be able to offer any opinion?

          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

          Comment


          • #65
            I don't understand the question. There is no covariance structure to choose in -xtreg, fe-, nor with -mi estimate-. The matrix e(V) is the estimated covariance matrix of the coefficient estimates--but its structure is not something one can choose in any regression model. You may be thinking of the covariance matrix of the random effects or the covariance matrix of the residuals in a multi-level model such as one can estimate with -mixed-. But there is nothing analogous to that with -xtreg, fe- as the fixed effects are not random variables: they are estimated fixed constants, and in -xtreg, fe- the residual structure is constrained to be independent.

            Comment


            • #66
              Dear Clyde and all,

              I would like your input about the example of analysing the association between meat consumption and renal function in a prospective cohort. This time, we would like no analyse changes in meta consumption (difference between visit 1 and 0) and renal function over 2 years of follow-up. We have run a linear mixed model using the mixed command in STATA 15. Our hypothesis is that higher meat consumption is detrimental to renal function. Our hypothesis is that an increase in meat consumption over time is detrimental to renal function.

              Independent variable--> meat_change_tert = tertiles of changes in meat consumption after one-year of follow-up (meat_change = meat_visit1 – meat_visit0). Tertile 1 = 1, Tertile 2 = 2, Tertile 3 = 3


              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:
              eGFR_visit0: eGFR levels at baseline (mL/min/m2)
              meat_visit0: meat consumption at baseline (g/d)
              sex: 0 = males, 1 = females
              BMI: body mass index at baseline (kg/m2)
              int_group: intervention group: 0 = control 1 = intervention
              smoking: smoking status at baseline 1= never, 2 = current, 3 = former
              educat: educational level at baseline: 1 = elementary school, 2 = high school, 3 = university
              alcohol_visit0: tertiles of alcohol consumption at baseline (g/day)
              physical_activity_visit0: physical activity at baseline (METS/week)
              energy_intake_visit0: total energy intake at baseline (kcal/day)
              id: identification of participants
              center: center of recruitment
              idcluster: clustering of participants by cohabitants

              Following you can see the code that we used

              Code:
              input id    sex    age    idcluster    int_group    physical_activity_visit0    energy_intake_visit0    meat_visit0    meat_visit1    meat_visit2    center    eGFR0    eGFR_visit0    eGFR1    eGFR2    smoking    educat    alcohol_visit0    energy_visit0_tert    meat_change    meat_change_tert
              2009    1    64    2009    1    1538.46    2234.9863    124.725    93.069    110.691    2    66.00282    66.00282    58.99583    .    2    1    1    2    -31.656    1
              2042    1    71    2042    0    773.89    2151.2517    115.695    100.44    79.593002    2    71.22556    71.22556    .    .    3    0    1    1    -15.255    2
              2044    0    72    2044    1    2853.15    2736.0999    214.494    93.866997    115.68    2    47.39903    47.39903    45.05989    .    2    0    3    3    -120.627    1
              2046    1    74    2046    0    3104.9    1277.1776    89.025002    99.834    68.270996    2    44.66863    44.66863    51.28111    .    3    0    1    1    10.809    3
              2050    0    70    2050    0    0    2359.4419    61.713001    116.46301    158.505    2    70.90691    70.90691    64.00393    .    2    0    3    2    54.75    3
              2064    1    65    2064    0    1608.39    1870.1116    127.56    69.572998    124.704    2    43.3642    43.3642    .    .    3    0    1    1    -57.987    1
              2075    0    66    25368    0    0    2418.4939    110.66    104.711    152.09399    2    74.90878    74.90878    78.72234    .    2    1    3    2    -5.949005    2
              2083    0    70    2083    1    1146.85    1820.3125    70.448997    115.44    65.669998    2    74.69798    74.69798    76.42227    .    2    1    2    1    44.991    3
              2111    0    65    2111    0    1636.36    2020.0663    137.10001    182.814    159.015    2    82.73673    82.73673    79.03849    .    2    1    2    1    45.71399    3
              2131    1    66    2131    0    4559.44    2537.7676    153.045    164.69    119.088    2    61.58834    61.58834    62.84118    .    3    0    1    2    11.645    3
              2143    0    71    2143    0    2139.86    1713.6956    129.69901    149.94901    153.285    2    84.32594    84.32594    78.22964    .    3    0    2    1    20.25    3
              2170    0    56    2170    1    22.38    2408.1111    114.725    90.537003    54.255001    2    67.17226    67.17226    65.36281    .    3    2    1    2    -24.188    2
              2183    0    72    25476    1    4322.61    1550.0358    73.299004    58.539001    25.416    2    81.5985    81.5985    71.88956    .    3    1    2    1    -14.76    2
              2190    0    65    2190    1    2517.48    2319.8416    111.84    122.418    126.144    2    68.80585    68.80585    68.53063    .    2    0    1    2    10.578    3
              2210    1    69    25503    1    1780.89    1670.6375    48.549    110.691    .    2    62.33946    62.33946    64.43452    .    3    0    1    1    62.142    3
              2220    1    60    25446    1    2517.48    1850.5388    130.44    192.099    129.94501    2    94.31626    94.31626    86.83787    .    3    1    1    1    61.659    3
              3003    0    74    3003    0    6525.87    2591.6167    140.88901    194.946    132.804    3    37.50098    37.50098    34.82178    38.27262    2    0    2    2    54.05699    3
              3004    1    67    3004    1    3496.5    1858.5002    171.39    117.105    .    3    69.53572    69.53572    78.39635    .    3    0    1    1    -54.285    1
              3005    1    67    3005    1    559.44    2305.5173    278.98999    .    .    3    62.08365    62.08365    .    .    2    0    3    2    .    .
              3007    1    70    3007    1    195.8    2641.7759    162.339    .    112.824    3    55.88116    55.88116    .    67.00107    3    0    1    2    .    .
              3008    0    64    3008    1    209.79    3544.9343    189.94501    141.375    .    3    72.63276    72.63276    53.24464    .    2    1    3    3    -48.57001    1
              3010    1    66    3010    0    2624.71    2815.5703    168.153    .    .    3    68.02046    68.02046    .    .    3    0    1    3    .    .
              3011    0    59    3011    1    1944.06    2228.5334    90.048004    174.72    179.00999    3    64.84095    64.84095    66.10393    56.74689    2    2    2    2    84.672    3
              3012    0    65    3012    0    3753.85    3371.3757    102.084    131.61301    122.823    3    90.31069    90.31069    76.92508    62.54368    2    1    3    3    29.52901    3
              3013    1    74    3013    0    1048.95    2804.6077    164.46001    145.901    85.200005    3    69.43182    69.43182    72.0386    58.23426    3    0    2    3    -18.55901    2
              3014    0    73    3014    0    1131.47    2896.1794    244.23399    156.713    111.41    3    64.25367    64.25367    60.35955    57.24165    3    0    3    3    -87.521    1
              3016    1    69    3016    1    4468.53    3104.0505    131.38499    101.394    124.725    3    58.05754    58.05754    66.08524    60.12492    3    1    2    3    -29.991    1
              3017    1    64    3017    1    167.83    1401.7478    134.265    111.405    104.724    3    78.52779    78.52779    102.1087    71.40739    3    1    1    1    -22.86    2
              3018    1    63    3018    1    5724.94    2305.8472    150.905    .    203.271    3    63.85678    63.85678    .    50.96976    2    1    2    2    .    .
              3023    1    60    3023    1    3356.64    2985.7959    225.18001    225.675    126.63    3    51.14634    51.14634    71.22819    57.47118    1    0    1    3    0.4949951    2
              3024    0    65    3024    0    3041.96    3499.3413    165.90601    159.21901    271.60501    3    75.20961    75.20961    94.18964    78.40744    2    0    3    3    -6.686996    2
              3025    0    69    3025    0    4041.96    2699.2332    157.095    91.869003    139.485    3    81.42086    81.42086    88.51887    91.95158    2    0    2    3    -65.226    1
              3026    0    67    3026    1    11258.74    2503.1963    202.89301    178.035    79.112999    3    53.35978    53.35978    67.98348    50.64233    1    0    2    2    -24.858    2
              3028    0    57    3028    1    999.53    1908.2826    78.999001    .    61.395    3    104.1045    104.1045    95.75971    83.23357    1    1    2    1    .    .
              3029    0    65    3029    0    6818.18    3446.5979    194.21899    101.834    130.41    3    81.58216    81.58216    95.68163    78.40744    2    0    3    3    -92.38499    1
              3030    1    68    3030    0    97.9    2704.5403    147.58501    90.419998    .    3    57.62432    57.62432    48.83477    43.12189    2    0    1    3    -57.16501    1
              3031    0    69    26324    0    671.33    2605.5051    90.425003    77.099998    141.855    3    52.93376    52.93376    50.64233    46.08305    2    1    3    2    -13.325    2
              3032    1    74    26324    0    335.66    2654.4443    146.145    128.04001    124.71    3    79.9783    79.9783    80.86274    75.61882    3    0    3    2    -18.105    2
              3034    1    70    3034    0    4825.17    2741.3401    179.00999    139.965    139.965    3    57.16425    57.16425    62.60332    62.87545    3    1    1    3    -39.045    1
              3035    0    75    3035    0    1286.71    2939.1943    118.853    98.540001    94.971001    3    72.25481    72.25481    61.99786    63.74029    2    1    1    3    -20.313    2
              3036    0    62    3036    1    279.72    2935.8655    116.871    .    .    3    55.57242    55.57242    74.82943    .    1    0    3    3    .    .
              3037    1    72    3037    1    3090.91    3047.0356    135.90001    121.395    109.965    3    62.3529    62.3529    60.60846    63.15609    3    1    2    3    -14.50501    2
              3038    1    69    3038    0    522.14    1766.8047    99.014999    41.400002    .    3    64.69329    64.69329    .    .    3    1    1    1    -57.615    1
              3039    1    66    3039    1    466.2    2423.5156    203.535    121.395    136.155    3    65.47586    65.47586    51.83876    65.51278    3    1    1    2    -82.14001    1
              3041    1    73    3041    1    1510.49    2511.5762    231.855    113.868    126.144    3    72.61838    72.61838    70.37427    .    3    0    1    2    -117.987    1
              3042    0    69    3042    0    6503.5    2872.8081    292.07599    266.595    243.285    3    62.2935    62.2935    69.13574    49.25925    2    0    3    3    -25.48099    2
              3044    0    57    3044    0    17902.1    3118.6736    113.868    169.97    148.53    3    86.65469    86.65469    77.34959    72.87458    1    1    3    3    56.102    3
              3045    0    57    3045    1    1491.84    2749.606    229.246    .    .    3    60.42986    60.42986    .    .    2    0    1    3    .    .
              3046    1    70    3046    1    2237.76    1980.3954    170.439    189    210.89999    3    80.07384    80.07384    93.84401    84.04053    3    0    1    1    18.561    3
              3047    0    65    3047    0    6363.64    2545.5969    144.23401    112.8    126.605    3    42.58451    42.58451    .    .    1    1    2    2    -31.43401    1
              end
              
              reshape long eGFR, i(id) j(visit)
              mixed eGFR i.meat_change_tert eGFR_visit0 meat_visit0 age i.sex i.int_group i.smoking i.educat i.alcohol_visit0 physical_activity_visit0 energy_intake_visit0 i.visit i.meat_change_tert#i.visit || center: || idcluster: || id:
              margins i.visit#i.meat_change_tert
              contrast [email protected]_change_tert, effect
              contrast i.visit#i.meat_change_tert, effect
              We would like to know if this analysis is correct. We are unsure whether we can analyse changes in our exposure (visit 0 to 1) with the outcome at three points (visit 0, 1 and 2).
              We have been told to include baseline eGFR (eGFR_visit0) as a covariable in the model. Is this correct considering that "eGFR" already takes into account glomerular filtration rates at visits 0, 1 and 2?

              Thank you for your help.

              Comment


              • #67
                It does not make sense to both include baseline values in the model and also include observations for visit 0. Either of those alone is a reasonable way to model this. But both together is not.

                Other comments about this design. It is, in general, not a good idea to convert continuous variables into categories. I would not use tertiles of meat consumption change. I would use the meat consumption change itself. Actually, I wouldn't use either, because change scores are also often problematic as variables. I would expect the measurement of meat consumption to have a large amount of measurement error. Calculating change scores increases the amount of measurement error. And then categorizing increases it further. So you have taken a starting variable that probably has a barely tolerable amount of noise in it and converted it into a deafening roar! I would just use meat consumption itself as the main explanatory variable.

                Comment


                • #68
                  Thanks for your input, Clyde.
                  Do you then suggest including only meat at baseline? using the following code:
                  Code:
                  mixed eGFR i.meat_visit0 age i.sex i.int_group i.smoking i.educat i.alcohol_visit0 physical_activity_visit0 energy_intake_visit0 i.visit i.meat_visit0#i.visit || center: || idcluster: || id:
                  Maybe it is also worth a try the including it as repeated measurements:

                  Code:
                  reshape long eGFR meat_visit, i(id) j(visit)
                  mixed eGFR i.meat_visit age i.sex i.int_group i.smoking i.educat i.alcohol_visit0 physical_activity_visit0 energy_intake_visit0 i.visit i.meat_visit#i.visit || center: || idcluster: || id:

                  Comment


                  • #69
                    I understood you to be interested in how changing meat consumption affects eGFR. The first model you show in #68 won't do that because it only contains the baseline value of meat. The approach using the long data layout and the second model you show in #68 makes sense to me.

                    Comment

                    Working...
                    X