Announcement

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

  • Please help: Questions about means

    Dear All

    If i have a categorical/nominal variable (Job Grade) and a continous variable (Job Satisfaction) and i want to produce a table on Stata that has the mean of job satisfaction for each of the categories in the first variable. What command can I use?

    Also if i am comparing between two means and their values are quite similar (4.02 and 3.91), do I still need to perform a t-test? or t-tests are only reserved when there is significant difference?

    Thank you

  • #2
    there are a lot of commands; here is one simple way:
    Code:
    help tabulate_summarize

    Comment


    • #3
      Another way is to do it with regression.

      reg Job_Satisfaction i.Job_Grade.

      This has the advantage that would give you the statistical test of which group is different from the omitted group.

      Comment


      • #4
        Code:
        clear
        set obs 100
        gen int job_category = ((_n-1)/10)
        gen job_satisfaction = runiform(3,5)
        
        * Stata 16 or earlier
        version 16: table job_category, c(mean job_satisfaction)
        
        * Stata 17
        table (job_category), stat(mean job_satisfaction) nototals
        
        * Using the estout suite
        eststo: qui estpost tabstat job_satisfaction, by(job_category) statistics(mean sd)
        esttab, main(mean) aux(sd) nostar unstack noobs nonote nomtitle nonumber
        Honestly though, just perusing the drop-down menus under "Summaries, tables, and tests" would probably give you everything you need.

        In terms of testing their differences via a t-test, "significant difference" is kind of the point. Significant relative to what? Well, significant relative to the standard error of the means. This is what a t-test is. If you don't have a lot of data and there is wide dispersion around the means, you can maybe get away with eyeballing the standard errors, but you have to be explicit about it.

        Comment


        • #5
          Also if i am comparing between two means and their values are quite similar (4.02 and 3.91), do I still need to perform a t-test? or t-tests are only reserved when there is significant difference?
          If you don't have a lot of data and there is wide dispersion around the means, you can maybe get away with eyeballing the standard errors, but you have to be explicit about it.
          And, if you do have a large data set, a difference that is too small to have any real-world consequences might nevertheless be statistically significant. My preferred approach is this. Do the t-test. Ignore the p-values and t-statistics. Look at the line of the output table that begins with "diff." That row gives you the difference between the means, and, over to the right, a 95% confidence interval. Now think about how big is the difference that matters for practical purposes in real life. If the confidence interval lies entirely below that smallest meaningful difference, then whether the observed difference is statistically significant or not, there is no meaningful difference and you should describe the results accordingly. If, however, the confidence interval lies entirely above the smallest meaningful difference, then you have good support in your data for a meaningful amount of difference, and you can describe your results accordingly. If that smallest meaningful difference lies inside the confidence interval, then the data do not support a clear conclusion about whether the difference between groups is meaningful or not and you should consider your study inconclusive with respect to that question.

          Comment


          • #6
            Still relevant after all these years:

            McCloskey, Deirdre N., and Stephen T. Ziliak. “The Standard Error of Regressions.” Journal of Economic Literature 34, no. 1 (1996): 97–114. http://www.jstor.org/stable/2729411
            Last edited by Malcolm Wardlaw; 17 Aug 2022, 10:17.

            Comment

            Working...
            X