Hello Everyone,
I was just trying to understand the one sample test and two sample test. I have created the below dataset and applied the procedures to perform the one sample t test and two sample t test
Here's my code
options validvarname=upcase;
DATA your_dataset;
INPUT Gender $ TreatmentGroup $ ResponseRate;
DATALINES;
M A 0.75
F B 0.60
F A 0.38
M A 0.43
F A 0.70
M B 0.55
F B 0.26
;
RUN;
proc print data= your_dataset; run;
/* Null: mean ResponseRate = 0.25 */
/* Alt: mean ResponseRate < 0.25*/
title 'One sample t test';
footnote 'With a p-value of 0.9968, which is greater than the significance level of 0.05. Therefore, we fail to reject the null hypothesis and conclude that we do not have enough evidence to support the claim that the mean ResponseRate is significantly different from 0.25.';
proc ttest data=your_dataset sides=L h0=0.25 alpha=0.05 plots=none;
var ResponseRate;
run;
/* Null: mean ResponseRate for males = mean ResponseRate for females */
/* Alt: mean ResponseRate for males != mean ResponseRate for females*/
/* Two sample t test categorical vs continuous */
title 'Two sample t test';
footnote 'With a p-value of 0.8324, which is greater than the significance level of 0.05, we fail to reject the null hypothesis. Therefore, we do not have enough evidence to support the claim that the mean ResponseRate for males is significantly different from females in the population represented by the dataset.';
PROC TTEST DATA=your_dataset plots=none;
CLASS Gender;
VAR ResponseRate;
RUN;
Below is my output ss.
Just wanted to check whether my approach, and my output representation i mean the explanation is correct or not. Appreciate any help!
Regards,
Sangeeta
Please show us screen captures of the PROC TTEST output you are seeing. Use the "Insert Photos" icon to include the output in your reply. DO NOT attach files.
Then, please ask specific questions about what is confusing your in this output.
Please show us screen captures of the PROC TTEST output you are seeing. Use the "Insert Photos" icon to include the output in your reply. DO NOT attach files.
Then, please ask specific questions about what is confusing your in this output.
@u48512177 wrote:
Thanks 🙂
This is very misleading. You fail to state that you have added the information requested to the original post. Do not withhold information from us.
In the future, do not add information to the original post, as that makes the thread unreadable. Add new information to a reply.
Your first conclusion is correct. Your second conclusion uses the wrong p-value of 0.8324, and so your conclusion should apply to variances being equal, rather than means being equal.
Apologies, I'll take a note about this.
Thanks for the response.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.