Announcement

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

  • How to correct the effect of covariates?

    Hello,

    I have a dependent variable and several independent variable. Assume that all independent variable have significant impacts on the dependent variable, how should I investigate only one independent's impact while other independent variable are treated as covariates whose impact are corrected?

    Tom

  • #2
    Tom:
    your query sounds a bit obscure (to me, at any rate).
    if you're referring to a regression context, each coefficient contributes to explain the variation in the dependent variable caused by a given independent variable when adjusted for the remaining predictors.
    Assuming you're dealing with OLS, see also -estat esize- in -regress postestimation- entry, Stata .pdf manual.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      In one of reference, the author do a survival analysis with Cox regression model. The independent variable under investigation were genotypes (groups), and hazard were estimated according to Cox regression model. In survival analysis, there are three basic functions, including survivorship function, density function, and hazard function. The author chose the hazard function as the target to observe and analyze. The author did the analysis with and without adjustments, for covariates such as age, sex, warfarin dose, indication for therapy. So I just want to know how to define and do a Cox regress analysis (and other types of tests) with adjustments for covariates. What is the command (option) in Stata?

      Also, now I divided my patients into two groups by gender, and I plan to do a t-test with unequal standard deviation for a variable (daily drug dose). Can I control other factors such as genotype, age, body surface area (which might also influence the interested variable [daily drug dose]) while I do the t-test? I mean, these factors other than gender would also impact the investigated variable (daily dose). If I do a t-test, how should I conclude that the result is from gender but not from covariates?

      Tom

      Comment


      • #4
        Tom:
        thanks for providing further details (for the future, please post all the stuff on your first message, so that replies can be more helpful from the very start. Thanks).
        You probably refer to:
        . a series of univariate Cox regression that usually appera in biostatistics articles. Their scope is usually to spot the "most relevant" predictors (whatever that means): in my opinion, that approach is seldom meningful, in that:
        1) regression modelling should be driven by the goal of reporting a fair and true view of the data generating process;
        2) analyzing the effect of each predictor separately is often a waste of time, when, say, interactions among predictors are the core issue:
        Code:
        . use "http://www.stata-press.com/data/r14/cancer.dta", clear
        (Patient Survival in Drug Trial)
        
        . stcox i.drug
        
                 failure _d:  died
           analysis time _t:  studytime
        
        Iteration 0:   log likelihood = -99.911448
        Iteration 1:   log likelihood = -86.958129
        Iteration 2:   log likelihood = -86.375607
        Iteration 3:   log likelihood = -86.345511
        Iteration 4:   log likelihood = -86.345483
        Refining estimates:
        Iteration 0:   log likelihood = -86.345483
        
        Cox regression -- Breslow method for ties
        
        No. of subjects =           48                  Number of obs    =          48
        No. of failures =           31
        Time at risk    =          744
                                                        LR chi2(2)       =       27.13
        Log likelihood  =   -86.345483                  Prob > chi2      =      0.0000
        
        ------------------------------------------------------------------------------
                  _t | Haz. Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
                drug |
                  2  |   .2307664    .111665    -3.03   0.002     .0893895    .5957423
                  3  |   .0707403   .0433131    -4.33   0.000     .0213055    .2348783
        ------------------------------------------------------------------------------
        
        . stcox age
        
                 failure _d:  died
           analysis time _t:  studytime
        
        Iteration 0:   log likelihood = -99.911448
        Iteration 1:   log likelihood = -97.341869
        Iteration 2:   log likelihood = -97.336126
        Refining estimates:
        Iteration 0:   log likelihood = -97.336126
        
        Cox regression -- Breslow method for ties
        
        No. of subjects =           48                  Number of obs    =          48
        No. of failures =           31
        Time at risk    =          744
                                                        LR chi2(1)       =        5.15
        Log likelihood  =   -97.336126                  Prob > chi2      =      0.0232
        
        ------------------------------------------------------------------------------
                  _t | Haz. Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
                 age |   1.079845   .0364047     2.28   0.023     1.010799    1.153607
        ------------------------------------------------------------------------------
        - a multivariable Cox regression, which should be meaningful:
        Code:
        . use "http://www.stata-press.com/data/r14/cancer.dta", clear
        (Patient Survival in Drug Trial)
        . stcox i.drug age
        
                 failure _d:  died
           analysis time _t:  studytime
        
        Iteration 0:   log likelihood = -99.911448
        Iteration 1:   log likelihood = -82.331523
        Iteration 2:   log likelihood = -81.676487
        Iteration 3:   log likelihood = -81.652584
        Iteration 4:   log likelihood = -81.652567
        Refining estimates:
        Iteration 0:   log likelihood = -81.652567
        
        Cox regression -- Breslow method for ties
        
        No. of subjects =           48                  Number of obs    =          48
        No. of failures =           31
        Time at risk    =          744
                                                        LR chi2(3)       =       36.52
        Log likelihood  =   -81.652567                  Prob > chi2      =      0.0000
        
        ------------------------------------------------------------------------------
                  _t | Haz. Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
                drug |
                  2  |   .1805839   .0892742    -3.46   0.001     .0685292    .4758636
                  3  |   .0520066    .034103    -4.51   0.000     .0143843    .1880305
                     |
                 age |   1.118334   .0409074     3.06   0.002     1.040963    1.201455
        ------------------------------------------------------------------------------
        As far as your last question is concerned, you should consider a (linear) regression model: -ttest- can't work the way you would hope it does.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          OK. Let's focus on the Cox regression model. It's likely that Cox regression model is used to compute the hazard ratio between two groups. I read a paper form NEJM, the author listed the hazard ratio by Cox regression model, with and without adjustment. I just want to know how to do adjustment in Stata. Thanks.

          Click image for larger version

Name:	Screen Shot 2017-09-10 at 2.36.37 PM.png
Views:	1
Size:	333.5 KB
ID:	1409854

          Comment


          • #6
            Tom:
            the adjusted HRs are those obtained via my second code (you can easily contrast them with HRs reported for each univriate Cox regression).
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Originally posted by Carlo Lazzaro View Post
              Tom:
              the adjusted HRs are those obtained via my second code (you can easily contrast them with HRs reported for each univriate Cox regression).
              Wow! That's so easy. So I just put all candidate variable after the stcox command and Stata would make the adjustment automatically? Look at this example, for my clarification:

              Code:
              . stcox age gender vkorc1
              So that the Stata would list the hazard ratios for age, gender, and vkorc1 and for each variable, the other two variables' impacts have been adjusted, right?

              Comment


              • #8
                Correct!
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9
                  Tom Hsiung I'd like to make a suggestion. Take a break from your project and invest some time in learning the basics of Stata. The PDF manuals that come with your Stata installation are excellent. Select PDF Documentation from the Help menu. Begin with the Getting Started [GS] and User's Guide [U] volumes. They will acquaint you with the Stata user interface and with the overall approach to data management and analysis in Stata. You will also become familiar with the general approach of Stata syntax and with the commands that are indispensable for effective day-to-day use of Stata. You will not remember all the details (though after a period of regular use, they will stick in your memory), but you will be able to identify those commands that are most likely to be helpful in any given situation. Then you can refer to the help files or back to the command-specific sections of the PDF documentation for the finer points. If you do this, your investment of time will be amply repaid. While there is some virtue to learning statistics through practice on real world examples, I think that the benefits of that approach only start once you have an overall appreciation for how the software works. Jumping prematurely into a project just makes the experience unnecessarily difficult and frustrating, a bit like trying to do a marathon your first time out running.

                  Let me add that if survival analysis is going to be an important component of your work, you should also read the [ST] volume.
                  Last edited by Clyde Schechter; 10 Sep 2017, 09:54.

                  Comment

                  Working...
                  X