Announcement

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

  • Comparison of two group's mean and natural logarithm

    Hi,
    I'm a very new user of STATA
    I have data from a RCT study. I want to compare the difference in weight before and after treatment between my two groups. I have to convert my data using natural logarithm.
    Does anybody know which way is right:
    1) Convert all data by ln(x) command before doing natural logarithm and afterwards ttest
    2) Calculate the difference between weight before and after and then calculate the mean of ln(diff) and compare the two groups...?

    I hope somebody can help me.


  • #2
    I am taking you at your word that working on a logarithmic scale is appropriate. Weights often may reasonably be compared as measured or using a weaker transformation than logarithmic.

    2) is definitely wrong. In general, some of your differences will be negative and you may also get zero values. The logarithm of zero is not defined and the logarithm of a negative value is not useful here and in any case not defined using the Stata [NB, not STATA] function ln().

    1) is perhaps the most common approach. Note, as above, that ln() is not a command, but a function.

    A more elaborate approach would be to use glm with link(log).
    Last edited by Nick Cox; 08 Sep 2014, 03:53.

    Comment


    • #3
      Are you sure that you "have to" log-transform the weight? Why?

      See Vickers AJ & Altman DG: Analysing controlled trials with baseline and follow up measurements. BMJ 2001; 323: 1123-4.

      Code:
      regress weightafter treatment weightbefore
      I suggest that the initial analysis be made without transformation. Next, look at the residuals; then may - or not - lead you to the decision that a repeated analysis with log transformed data is appropriate.

      Comment


      • #4
        Thank you both for fine answers. Unfortunately my data is not nomally distributed.
        I have performed ln(weight delta+50) and then a ttest - it seems to be ok. A Mann-Whitney test gives approximately the same p-value and is perhaps more preferable...

        best regards

        Comment


        • #5
          That sounds at best dubious. I have to say that your analysis sounds very muddled.

          Weight being normally distributed is not essential for a t test here.

          What is weight delta? It sounds as if you are sticking with idea of working with ln of weight change, but change of ln weight is the only plausible metric that uses logarithms, and the two are not at all equivalent.

          Adding 50 before taking logs is something you would probably struggle to get past examiners or reviewers. It sounds like a kludge or fudge to make all changes positive.

          Showing your data, or graphs of your data, would help elicit better advice. Svend's strategy looked good to me too, and much sounder than what you did.

          Comment


          • #6
            As an aside to Nick and Svend's sound advices, LIne may want to consider a bootstrap ttest (see - help bootstrap - and related entry in Stata 13.1 .pdf manual).
            Kind regards,
            Carlo
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              I guess that by "weight delta" you mean the change in weight. The requirement of a distribution that does not deviate "too much" from a normal distribution applies to the change, not the original weight distributions. Furthermore, it is a requirement to each treatment group separately, not the joint distribution. In my suggestion in post #3, this is studied by examining the residuals after a regression.

              Considering the strong warnings, I suggest that you accept this invitation to illustrate the distribution of weight change in each treatment group, for example, by histograms.

              Comment

              Working...
              X