文章分類


有關阿原記事本

阿原,江易原,記下一些事情跟朋友們分享,也留下自己學習與成長的紀錄。教學課程請見 "阿原小站" 還有阿原開放式課程阿原直播與教學影片阿原生活影片阿原創新顧問公司阿原科幻小說-NC1543、教師教學社團:開源軟體與教學應用
版權:除特別聲明外,本網站之照片及文字等,皆為版權沒有 (public domain, Creative Commons Zero),歡迎使用
*本站累積不少教學與食品安全資料,請善用左上角的網頁搜尋功能,或是網頁右方文章分類整理。

2025/05/19

20250519 Statistics class assignment: Example 9.3.1 two samples t-test


 

 Source:

 9.3: Independent Samples for Two Means

  • Kathryn Kozak
  • Coconino Community College
  •  Example 9.3.1 hypothesis test for two means

     

     Calculated by using google sheet

    Cholesterol Level of Heart Attack Patients
    Cholesterol Level of Healthy Individual
    270196
    236232
    210200
    142242
    280206
    272178
    160184
    220198
    226160
    242182
    186182
    266198
    206182
    318238
    294198
    282188
    234166
    224204
    276182
    282178
    360212
    310164
    280230
    278186
    288162
    288182
    244218
    236170

    200

    176


    Mean, x1-barMean, x2-bar
    253.9285714193.1333333
    s1: sample SDs2: sample SD
    47.7104915622.30004381
    n1 n2
    2830

    -------------------------------

     Using an online application: 

     

    Mann Whitney U test calculator (Wilcoxon rank-sum)

     


     

     

    1. H0 hypothesis
    Since p-value < α, H0 is rejected.
    The randomly selected value of Group1's population is considered to be not equal to the randomly selected value of Group2's population.

    In other words, the difference between the randomly selected value of Group1 and the Group2 populations is big enough to be statistically significant.

    2. P-value
    The p-value equals 0.000001057, ( p(x≤Z) = 1 ). It means that the chance of type I error (rejecting a correct H0) is small: 0.000001057 (0.00011%).
    The smaller the p-value the more it supports H1.

    3. The statistics
    The test statistic Z equals 4.8808, which is not in the 99% region of acceptance: [-2.5758 : 2.5758].
    U=734, is not in the 99% region of acceptance: [254.5507 : 585.4493].

    4. Effect size
    The observed standardized effect size, Z/√(n1+n2), is large (0.64). That indicates that the magnitude of the difference between the value from Group1 and the value from Group2 is large.
    The observed common language effect size, U1/(n1n2), is 0.87, this is the probability that a random value from Group1 is greater than a random value from Group2.
    If you like the page, please share or like. Questions, comments and suggestions are appreciated. (statskingdom@gmail.com)

     ================================================

     

    The same source

    Example 9.3.3 hypothesis test for two means

     

    Sodium in Beef Hotdogs
    Sodium in Poultry Hotdogs
    495430
    477375
    425396
    322383
    482387
    587542
    370359
    322357
    479528
    375513
    330426
    300513
    386358
    401581
    645588
    440522
    317545
    319430
    298375
    253396

     

    This time, we use 

     https://www.graphpad.com/quickcalcs/ttest2/

     To run unpaired t-test

     


     

    P value and statistical significance:
    The two-tailed P value equals 0.1015
    By conventional criteria, this difference is considered to be not statistically significant.
    Confidence interval:
    The mean of Group One minus Group Two equals -49.05
    95% confidence interval of this difference: From -108.21 to 10.11
    Intermediate values used in calculations:
    t = 1.6783
    df = 38

    standard error of difference = 29.226
    Review your data:
    Group
    Mean
    SD
    SEM
    N
    Group One
    401.15
    102.43

    22.91
    20    
    Group Two
    450.20
    81.18

    18.15
    20     
     

     -----------conclusion

     p-value > alpha   (fail to reject Ho)

    In other words, there is no evidence to show that the sodium in beef hotdogs is less than poultry hotdogs