Announcement

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

  • Generate standard error of log (point estimate)

    Dear STATALIST,

    I am writing you as I am having some STATA issues regarding probably simple commands I cannot find.

    For a systematic review, as some of the studies do not explicitly report all data necessary for a meta-analysis, I am attempting to generate the estimates needed, with the little data provided. For a meta analysis, if a study provides the count data (i.e. value of n (observations) and value of N (total number of observations) per treatment group), the risk ratio (rr), log risk ratio (logrr), standard error of log risk ratio (selogrr), and lower (lcirr) and upper confidence (ucirr) interval limits around the log risk ratio can be computed with the following commands:

    //Generate risk ratio
    gen rr2= (n1/N1)/(n2/N2)

    //Generate ln(RR)
    gen logrr2=log(rr2)

    //Generate variance of ln(RR)
    gen varlogrr2=1/n1-1/N1+1/n2-1/N2



    //Generate SE of ln(RR)
    gen selogrr2=((varlogrr2)^(1/2))*1.22


    //Generate lower limit 95%ci of RR
    gen lcirr2=(log(rr2)-1.96*selogrr2)


    //Generate upper limit 95%ci of RR
    gen ucirr2=(log(rr2)+1.96*selogrr2)

    Some studies only provide the proportions with the corresponding p-value, and no other information. However, this is sufficient to at least compute the risk ratio, log of the risk ratio, get the z-score (from the p-value) and thus compute the standard error.

    I however do not know what command to use to then compute the log of the standard error, which as per the command above, I would need to be able to compute the confidence intervals around the log risk ratio. The variance would usually be used to compute the standard error, with 1.22 as a multiplier to account for clustering. However, I would need count data to be able to compute the variance.

    I was thus wondering if STATA had commands that would allow me to compute the log of the standard error, without having to use the variance of the log risk ratio?

    Here is a dataset containing the data I could compute based on the little information provided.


    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(RR logrr p1 p0 pv z)
    4.75 1.5581446 .19 .04 .18 1.34
    end
    ​​​​​​​

    Thank you very much.







  • #2
    Remember, that most of us are not from your area. If you tell us what exactly you need to calculate, then we can help. If you have a number (like a standard error) then generate will calculate a log.
    g lnx=ln(x)

    But this seems overly simple so I suspect your problem is not just calculating a log.

    Comment


    • #3
      Dear Akissi,

      I'm not sure I fully understand your setup -- where does the 1.22 and the clustering come from? Could you provide a reference for this?

      In the standard case, one would proceed exactly as you have done, obtaining the standard error from the p-value/z-score. This would then be used directly to produce a confidence interval. If we understood the additional methodology you are using, then maybe we could suggest a suitable modification to this approach.

      Regards,

      David.

      Comment


      • #4
        Dear Phil Bromiley and David Fisher,

        Thank you very much for your response and I apologize if my explanations were not clear.

        I am working on a systematic review. I am attempting to use the results of the evaluation of x intervention (e.g. binge drinking prevention intervention) in each of the studies I am including in the review, to be able to compute a summary estimate (risk ratio) of the effectiveness of that specific intervention. I do so by combining all studies results together to come up with one single estimate (which is referred to as a meta-analysis). To be able to compute each risk ratio (if not already provided by the papers), based on the results of each study, I normally need count data (i.e.number of observations in each study group (ni) and total number of observations (totalni) in each study group). When this is not provided, I need to use a longer route to compute the risk ratio (and then log risk ratio), which would involve using the compared proportions provided and their p-values.

        I am working on clustered data, as I am working with data from a clustered randomized controlled trial. This would mean that people from the same cluster (for instance household) would tend to be more similar than people from different clusters. Thus, the observations in a cluster are not independent from one another. This means that I have to account for clustering when computing confidence intervals, otherwise, the confidence intervals would be narrower than they should be (and show positive effect, when the effect may be negative). This is the reason why I multiply the standard error by 1.22 (I am assuming a design effect of 1.5, and 1.22 is the square root of 1.5).

        For this specific group of paper I am stuck on at the moment, I was provided with the proportions in both the intervention (e.g. 0.19) and the control groups (e.g. 0.04) after the intervention was implemented in the intervention group, with a p-value of 0.18. I have thus managed to find the corresponding z-score (2-tailed) of 1.34. With the provided proportions, I calculated the risk ratio (0.19/0.04= 4.75), and its standard error (3.54). I then used STATA to calculate the log of the risk ratio (log(4.75)=1.56).

        The issue I am now facing is that I need to calculate the standard error of the log risk ratio (thus SE of 1.56) and the confidence interval of the log risk ratio (using the computed SE)

        Normally, if I had the actual count data, I would be able to first compute with STATA the variance of the log risk ratio using the count data (gen variancelogrr2=1/n1-1/totaln1+1/n2-1/totaln2). I would then compute the standard error of the log risk ratio using this command: gen selogrr2=((variancelogrr2)^(1/2))*1.22 (with 1.22 to account for clustering). I would use this last command to compute the confidence interval of the log risk ratio (gen lcirr2=(log(rr2)-1.96*selogrr2).

        I thus need to be able to compute the standard error of 1.56 (The log risk ratio), to then be able to compute the confidence intervals of the log risk ratio.

        I however, do not know which command to use to bypass having to calculate the variance first, which would then be used to calculate the standard error and then confidence intervals. I am looking for a command to compute the standard error of 4.75, and then compute its confidence interval.

        I hope this is clearer.

        Thank you very much.

        Best wishes

        Comment


        • #5
          Dear Phil Bromiley and David Fisher,

          I am thinking that I may be doing something more complicated than needed. I am aware that, one of the formulas to compute a standard error is: SE=Point estimate/Z-value.
          I am assuming the point estimate in my case would be 1.56 (the log risk ratio), and z is 1.34. Thus, if that is correct, the standard error of the log estimate would be 1.56/1.34=1.16.
          If this approach sounds correct, I would thus have to manually compute the above, unless I could create a dataset where I would have each point estimate and Z-value as the variables, and I would need to generate a new variable containing the results of each point estimate/Z.

          Would this sound reasonable?

          Thank you very much.

          Best wishes.

          Comment


          • #6
            Dear Akissi,

            What you describe is the standard approach, yes. However, if clustering is thought to be an issue here, you should confirm whether the p-value came from an analysis where clustering was accounted for. If not, then you might be justified in inflating your standard error of 1.16 by 1.22 before calculating the confidence interval.

            Depending on the available data for each study in your meta-analysis (which remains unclear), you may have to apply different approaches on a study-by-study basis. But in order to perform a meta-analysis, ultimately you will need to have an effect size and standard error for every study which are equivalent (e.g. all are accounting, or not, for clustering).

            Does that help at all?

            Regards,

            David.


            P.S. I am still unclear where the 3.54 came from, as the "standard error of the risk ratio", in your previous post?

            Comment

            Working...
            X