Announcement

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

  • paired data problem

    I have data for the lipid profile before treatment, 4 weeks, 12 weeks after treatment.

    Paired data analyses showed that LDL significantly increased 4 weeks after treatment, and no difference was noted between 4wk and 12 wk.

    Could I conclude that the increase will mostly occur in 4 weeks after the treatment starts, and it isn't significant thereafter?

    What is a better analysis for the conclusion I want?

    Thank you.

  • #2
    Below are the results by paired t test. Thank you for your help.
    SVR is 12 week after treatment
    LDL is before treatment
    4wk is 4 wk after treatment
    Click image for larger version

Name:	4 week and 12 week.jpg
Views:	1
Size:	50.8 KB
ID:	1483193

    Click image for larger version

Name:	before treatment and 4 week.jpg
Views:	1
Size:	43.9 KB
ID:	1483194

    Comment


    • #3
      Cheng:
      looking at your outcome tables, what strikes me is the different number of observations between tests perfomed at 4 and 12 week after the treatment start.
      I find difficult to get what's your original sample size and why it increased from the the first to the second measurement.
      That said, you may want to consider a panel data regression (provided that the mesurements were taken on the same sample od patients):
      Code:
      xtreg LDL i.week
      As per -hausman- test you can investigate whether -fe- or -re- specification fits you data better.
      Kind regards,
      Carlo
      (Stata 18.0 SE)

      Comment


      • #4
        [QUOTE=Carlo Lazzaro;n1483220]Cheng:
        looking at your outcome tables, what strikes me is the different number of observations between tests perfomed at 4 and 12 week after the treatment start.
        I find difficult to get what's your original sample size and why it increased from the the first to the second measurement.
        That said, you may want to consider a panel data regression (provided that the mesurements were taken on the same sample od patients):
        Code:
        xtreg LDL i.week
        keep NO LDL LDL_4wk LDL_12wk LDL_SVR

        rename LDL LDL0

        rename LDL_4 LDL4

        rename LDL_12 LDL12

        rename LDL_SVR LDL24

        reshape long LDL, i(NO) j(wk)

        xtset NO

        Click image for larger version

Name:	test results1.png
Views:	1
Size:	10.3 KB
ID:	1484589



        I think the results mean that LDL values at week4/12/24 are all significantly higher than the baseline.

        Can the results tell me if the increase occurs more dramatically at the 4th week, and not after 4 weeks?

        As we can see, the coefficient jumps to 14 in 4 weeks, and only slightly climbs to 17 at 24 weeks.

        Thank you for your help, Carlo.



        Comment


        • #5
          Cheng:
          assuming that -re- specification is the way to go and that you did not detect heteroskedasticity and/or autocorrelation in your data (if that were the case, impose the -robust- option on your standard errors), your conclusion would make sense if your regression model were well specified with only -i.time- as a predictor.
          I think you have probably collected other predictors, such as age, geneder and comorbidities of patients enrolled in your study.
          If that were the case, I would plug them in the right-hand side of your regression equation and see what happens with your outcome.
          Besides, post estimation test play a relevant role in detecting model misspecification.
          For instance, you can run the Pregibon test (see references and assumptions under -linktest- esntry in Stata .pdf manual) like in the following toy-example:
          Code:
          . use "http://www.stata-press.com/data/r15/nlswork.dta"
          (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
          
          . quietly xtreg ln_wage age i.year, fe
          
          . estimates store fe
          
          . quietly xtreg ln_wage age i.year, re
          
          . estimates store re
          
          *Hausman test*
          
          . hausman fe re
          
                           ---- Coefficients ----
                       |      (b)          (B)            (b-B)     sqrt(diag(V_b-V_B))
                       |       fe           re         Difference          S.E.
          -------------+----------------------------------------------------------------
                   age |    .0125992     .0137208       -.0011216          .01004
                  year |
                   69  |    .0748621     .0744312        .0004309        .0098206
                   70  |    .0478697     .0453659        .0025038        .0202541
                   71  |    .0865577     .0819949        .0045629        .0303028
                   72  |    .0856757     .0827461        .0029296        .0402525
                   73  |    .0880069     .0840751        .0039318        .0503357
                   75  |    .0778607     .0707387         .007122         .070056
                   77  |     .108365     .1032639        .0051011        .0900953
                   78  |    .1309518     .1279039        .0030479        .1005435
                   80  |    .1142649      .108871        .0053939        .1202629
                   82  |    .1090451      .098831        .0102141        .1403289
                   83  |    .1211272     .1127655        .0083617        .1502649
                   85  |    .1465637     .1380611        .0085026        .1703831
                   87  |    .1382642     .1264818        .0117824        .1905725
                   88  |    .1799741     .1640382        .0159359        .2042295
          ------------------------------------------------------------------------------
                                     b = consistent under Ho and Ha; obtained from xtreg
                      B = inconsistent under Ha, efficient under Ho; obtained from xtreg
          
              Test:  Ho:  difference in coefficients not systematic
          
                           chi2(15) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                                    =       81.61
                          Prob>chi2 =      0.0000
          
          . quietly xtreg ln_wage age i.year, fe
          
          . predict fitted, xb
          (24 missing values generated)
          
          . g sq_fitted=fitted^2
          (24 missing values generated)
          
          *Pregibon test*
          
          . xtreg ln_wage fitted sq_fitted, fe
          
          Fixed-effects (within) regression               Number of obs     =     28,510
          Group variable: idcode                          Number of groups  =      4,710
          
          R-sq:                                           Obs per group:
               within  = 0.1086                                         min =          1
               between = 0.0962                                         avg =        6.1
               overall = 0.0845                                         max =         15
          
                                                          F(2,23798)        =    1449.33
          corr(u_i, Xb)  = 0.0519                         Prob > F          =     0.0000
          
          ------------------------------------------------------------------------------
               ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                fitted |   4.791882   .4570443    10.48   0.000     3.896046    5.687718
             sq_fitted |  -1.125657   .1355632    -8.30   0.000    -1.391369   -.8599442
                 _cons |    -3.1774   .3839526    -8.28   0.000    -3.929971   -2.424828
          -------------+----------------------------------------------------------------
               sigma_u |  .40489607
               sigma_e |  .30248347
                   rho |  .64180514   (fraction of variance due to u_i)
          ------------------------------------------------------------------------------
          F test that all u_i=0: F(4709, 23798) = 8.78                 Prob > F = 0.0000
          
          . test sq_fitted
          
           ( 1)  sq_fitted = 0
          
                 F(  1, 23798) =   68.95
                      Prob > F =    0.0000
          .
          As you can see, -hausman- outcome suggests to go -fe-, but the Pregibon test proves the regression model to be misspecified (that may happen for various reasons).
          Kind regards,
          Carlo
          (Stata 18.0 SE)

          Comment


          • #6

            -hausman- outcome suggests I go -re-.

            The results look like those from regression analyses.

            I can't tell the LDL increase is only significant between 0-4 week, but not 4-12 weeks, not 4-24 weeks, and not 12-24 weeks, from the results.

            What do I miss?

            I have problems with -Pregibon test- and will study about it later.



            Click image for larger version

Name:	hausman.png
Views:	1
Size:	6.2 KB
ID:	1484608

            Comment


            • #7
              Cheng:
              I fail to get your concern.
              if -hausman- outcome pointed you to -re-, this exactly what you have already did (see the results in #4).
              I fail also to get what kind of problems you have with the Pregibon test.
              Kind regards,
              Carlo
              (Stata 18.0 SE)

              Comment


              • #8
                Originally posted by Carlo Lazzaro View Post
                Cheng:
                I fail to get your concern.
                Sorry that I didn't present my question well.
                My question is:
                May I have pairwise comparison results after performing panel data analyses? (wk4 vs wk12, wk4 vs wk24, w12 vs wk24, etc..)

                Like the results from post-hoc analyses after performing ANOVA.

                Comment


                • #9
                  Cheng:
                  yes, you can, as you can see in the following toy-example:

                  Code:
                  . use "http://www.stata-press.com/data/r15/nlswork.dta"
                  . xtreg ln_wage i.year
                  
                  Random-effects GLS regression                   Number of obs     =     28,534
                  Group variable: idcode                          Number of groups  =      4,711
                  
                  R-sq:                                           Obs per group:
                       within  = 0.1058                                         min =          1
                       between = 0.0796                                         avg =        6.1
                       overall = 0.0724                                         max =         15
                  
                                                                  Wald chi2(14)     =    3198.67
                  corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
                  
                  ------------------------------------------------------------------------------
                       ln_wage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                  -------------+----------------------------------------------------------------
                          year |
                           69  |   .0854251   .0123808     6.90   0.000     .0611592    .1096911
                           70  |    .069889   .0115653     6.04   0.000     .0472215    .0925566
                           71  |   .1196013   .0114272    10.47   0.000     .0972043    .1419983
                           72  |   .1327835   .0117484    11.30   0.000      .109757    .1558099
                           73  |   .1476736   .0113915    12.96   0.000     .1253467    .1700006
                           75  |   .1609048   .0112586    14.29   0.000     .1388385    .1829712
                           77  |   .2207951   .0112687    19.59   0.000     .1987089    .2428814
                           78  |   .2596833   .0115128    22.56   0.000     .2371186     .282248
                           80  |    .267724   .0116586    22.96   0.000     .2448735    .2905745
                           82  |   .2852433   .0113995    25.02   0.000     .2629007    .3075859
                           83  |   .3126372   .0115421    27.09   0.000     .2900152    .3352592
                           85  |   .3653587   .0114383    31.94   0.000       .34294    .3877773
                           87  |   .3813851   .0113703    33.54   0.000     .3590997    .4036706
                           88  |   .4370689   .0113081    38.65   0.000     .4149054    .4592325
                               |
                         _cons |   1.426677   .0103611   137.70   0.000     1.406369    1.446984
                  -------------+----------------------------------------------------------------
                       sigma_u |  .36928787
                       sigma_e |  .30294584
                           rho |  .59773703   (fraction of variance due to u_i)
                  ------------------------------------------------------------------------------
                  
                  . test (69.year=70.year) (69.year=71.year)(70.year=71.year), mtest(bonferroni)
                  
                   ( 1)  69.year - 70.year = 0
                   ( 2)  69.year - 71.year = 0
                   ( 3)  70.year - 71.year = 0
                         Constraint 3 dropped
                  
                  ---------------------------------------
                         |        chi2     df       p
                  -------+-------------------------------
                    (1)  |        1.76      1     0.5547 #
                    (2)  |        8.66      1     0.0098 #
                    (3)  |       22.55      1     0.0000 #
                  -------+-------------------------------
                    all  |       23.45      2     0.0000
                  ---------------------------------------
                           # Bonferroni-adjusted p-values
                  
                  .
                  Kind regards,
                  Carlo
                  (Stata 18.0 SE)

                  Comment

                  Working...
                  X