From f6ec998708a9845c5e386a7da311ba348eb36e09 Mon Sep 17 00:00:00 2001 From: YushufSharker Date: Mon, 21 Oct 2024 13:34:47 -0400 Subject: [PATCH] Update Model Checking on line 58 --- SAS/ttest_2Sample.qmd | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SAS/ttest_2Sample.qmd b/SAS/ttest_2Sample.qmd index e7ff9ba95..7d1a50971 100644 --- a/SAS/ttest_2Sample.qmd +++ b/SAS/ttest_2Sample.qmd @@ -11,7 +11,7 @@ knitr::opts_chunk$set(echo = TRUE) The following data was used in this example. -``` +``` data d1; length trt_grp $ 9; input trt_grp $ WtGain @@; @@ -26,7 +26,6 @@ treatment 109 treatment 115 treatment 39 treatment 96 treatment 87 treatment 100 treatment 76 treatment 80 ; run; - ``` ### **Independent Two-Sample t-test in SAS** {#sas} @@ -57,6 +56,8 @@ knitr::include_graphics("../images/ttest/test1.png") Here the t-value is --0.70, degrees of freedom is 30 and P value is 0.4912 which is greater than 0.05, so we accept the null hypothesis that there is no evidence of a significant difference between the means of treatment groups. The mean in placebo group is 75.1875 and mean in Treatment group is 83.1250. The mean difference the treatment groups (Treatment-Placebo) is --7.9375 and the 95% CI for the mean difference is \[--31.1984, 15.3234\]. The 95% confidence interval includes a treatment difference of 0, which supports the conclusion that the data fail to provide any evidence of a difference between the treatment groups. +### Model Checking + Note: Before entering straight into the t-test we need to check whether the assumptions (like the equality of variance, the observations should be independent, observations should be normally distributed) are met or not. If normality is not satisfied, we may consider using a suitable non-parametric test. 1. Normality: You can check for data to be normally distributed by plotting a histogram of the data by treatment. Alternatively, you can use the Shapiro-Wilk test or the Kolmogorov-Smirnov test. If the test is \<0.05 and your sample is quite small then this suggests you should not use the t-test. However, if your sample in each treatment group is large (say \>30 in each group), then you do not need to rely so heavily on the assumption that the data have an underlying normal distribution in order to apply the two-sample t-test. This is where plotting the data using histograms can help to support investigation into the normality assumption. We have checked the normality of the observations using the code below. Here for both the treatment groups we have P value greater than 0.05 (Shapiro-Wilk test is used), therefore the normality assumption is there for our data.