BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
u48512177
Fluorite | Level 6

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.

One sample t test.pngtwo sample t test.png


Just wanted to check whether my approach, and my output representation i mean the explanation is correct or not. Appreciate any help!

 

Regards,

Sangeeta

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
u48512177
Fluorite | Level 6
Thanks 🙂
PaigeMiller
Diamond | Level 26

@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.

--
Paige Miller
u48512177
Fluorite | Level 6

Apologies, I'll take a note about this. 
Thanks for the response.


SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

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.

Discussion stats
  • 4 replies
  • 1040 views
  • 0 likes
  • 2 in conversation