Announcement

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

  • How to compare the mean of a dataset with a reference mean (i.e. fixed mean) from the literature?

    Dear Stata experts,

    I want to compare the mean of my dataset with the mean of a reference population from the literature. I do not have access to the raw data of this reference population so I was wondering how I can perform a t-test comparing the mean of my dataset with a fixed mean/the mean of my reference population.

    I hope you can help me.

    Thank you in advance,
    Agnes

  • #2
    You can be that direct.

    Code:
    sysuse auto, clear
    ttest weight=3000

    Res.

    Code:
    . ttest weight=3000
    
    One-sample t test
    ------------------------------------------------------------------------------
    Variable |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
    ---------+--------------------------------------------------------------------
      weight |      74    3019.459    90.34692    777.1936    2839.398    3199.521
    ------------------------------------------------------------------------------
        mean = mean(weight)                                           t =   0.2154
    Ho: mean = 3000                                  degrees of freedom =       73
    
       Ha: mean < 3000             Ha: mean != 3000               Ha: mean > 3000
     Pr(T < t) = 0.5850         Pr(|T| > |t|) = 0.8301          Pr(T > t) = 0.4150
    Here, we fail to reject the hypothesis that the mean weight for cars in the auto dataset is 3000 lbs.

    Comment

    Working...
    X