Announcement

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

  • Bootstrapped CI for effect size for one sample t-test

    Hello,

    I need to test if across a series of studies, the mean response is significantly different from chance (i.e., 0.5 for binary outcomes). I calculated the effect size for one-sample t-test using this,
    gen delta = response - 0.5

    summ delta

    local esize_onesample `r(mean)'/`r(sd)'

    display =`esize_onesample'

    However, this does not give the confidence interval the effect size estimate that I need for running the meta analysis. Is there a way to obtain the confidence intervals for the effect size(s)?

    Thanks!

  • #2
    Shilpa, if I understand correctly, you have a cross-sectional data where each observation records the response from a study, and you'd like to test if the mean response is significantly different from 0.5.

    Code:
    gen delta = response - 0.5
    ttest delta == 0
    The code above directly runs the test and reports the 95% CI for delta. Not sure if it's what you need.

    Comment


    • #3
      Hi Fei, thank you, I need to conduct a meta analysis across studies. So let's say for Studies 1-3, the mean response is 0.62, 0.55, and 0.47. So I conducted a t-test for each of these studies comparing the mean value to 0.5. I am able to calculate the effect size for the t-test (using the code in my original post). But I don't know how to calculate the CIs for the effect size(s) which are needed to run a meta analysis. Not sure if I am being fully clear.

      Comment


      • #4
        Shilpa, it seems beyond my knowledge. But let me rephrase your question and see if others could help.

        A CI is constructed for a population parameter. According to your definition, the parameter, effect size, in the population should look like: (population average of response - 0.5) / (population standard deviation of response), and its corresponding sample statistic is (sample average of response - 0.5) / (sample standard deviation of response) which is what your code calculated. To construct a CI, we need something who has a known distribution and contains both the population parameter and sample statistic -- I have no idea what the "something" should be in your case.

        If we are not able to find theoretical foundation for the CI, then bootstraping seems to be the way.
        Last edited by Fei Wang; 28 Oct 2021, 20:00.

        Comment


        • #5
          Thanks Fei, appreciate it. Would you be able to recommend how to bootstrap the CIs?

          Comment


          • #6
            I am not sure how your procedure here is valid and if its the best way but putting this in a wrapper for bootstrapping is simple.

            Code:
            cap program drop wrapper
            program define wrapper, rclass
                syntax varlist(max=1) [if] [in]
                marksample touse
                gen delta = `varlist' - 0.5
                summarize delta if `touse' == 1
                return scalar esize = `r(mean)' / `r(sd)'
                drop delta
            end
            
            
            
            
            bootstrap r(esize): wrapper response
            help bootstrap
            Best wishes

            (Stata 16.1 MP)

            Comment

            Working...
            X