Announcement

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

  • Ttest between pop mean and sample mean

    Hi,


    For a balance table, I am working on, I have generated the sample means and proportion of my demographic values in the dataset and merged it with the population means and proportion (obtained from national level stats). I'm now attempting to calculate the t-test between each value and generate a p value column.

    The issue is, I am not sure how I can do this

    My data is as follows

    ```
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input str28 var float(sample population ttest)
    "% Employed" 44 60.2 .
    "% Female" 87 50.8 .
    "% Non-white" 76 28 .
    "% Parent" 82 54 .
    "% Under FPL 2019" 50 12 .
    "Age" 35 36.9 .
    "Debt stock ($)" 21533 90460 .
    "Earned income last mo. ($)" 816 93563 .
    "HH size" 3.7 2.53 .
    "Savings stock ($)" 843 16420 .
    "Unearned income last mo. ($)" 624 97759 .
    end

    ```

    Any suggestions? Alternatively, would a ttest be appropriate here or something like a chi-square test be more suited?

    Thanks!
    Last edited by Brendan Clark; 14 Jun 2021, 18:00. Reason: ttest

  • #2
    If you have the original sample data, you can go back to that and perform a one-sample t-test on each of these variables against their population statistics. Examples for testing if a proportion is equal to a certain number can be done with -prtest-, and for continuous variable it can be done with -ttest-. Examples and explanations can be found here (proportion) and here (continuous).

    Comment


    • #3
      you don't have (1) sd's for your quantitative variables (e.g., age) and you don't have N for your qualitative variables (e.g., employed) so you have a problem; further, some of the comparisons look very odd (e.g., "earned income in last mo"; so you have any other info? note that something could be done with your "%" variables but it's hard to see that it would be very helpful

      Comment

      Working...
      X