Help using Base SAS procedures

PROC MEANS class specify null value

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 110
Accepted Solution

PROC MEANS class specify null value

Hi everyone,

 

I am trying to do ttest of two groups to see if the group means are different from a fixed value. How can I specify the null value in PROC MEANS ttest?

 

proc means data=mydata t probt;

   class flag;

   var cost;

run;

 

Thank you!

Lizi


Accepted Solutions
Solution
‎08-23-2017 12:54 PM
Super User
Posts: 23,776

Re: PROC MEANS class specify null value

Or PROC UNIVARIATE, which is closer to what you want.

 



proc univariate data=sashelp.class mu0=5;
class sex;
var age;
run;

View solution in original post


All Replies
Super User
Posts: 23,776

Re: PROC MEANS class specify null value

Wouldn't you use PROC TTEST and H0 on the TTEST statement?
Solution
‎08-23-2017 12:54 PM
Super User
Posts: 23,776

Re: PROC MEANS class specify null value

Or PROC UNIVARIATE, which is closer to what you want.

 



proc univariate data=sashelp.class mu0=5;
class sex;
var age;
run;
Super User
Posts: 13,583

Re: PROC MEANS class specify null value

I would suggest using Proc TTest if you need to specify a value for the null hyposis.

 

To test difference of means between the level of the class variable (if two levels)

proc ttest data=mydata h0=<null hypothesis value>;
   class flag;
   var cost;
run;

To test if the mean of each level of the class variable has mean of xx

 

proc ttest data=mydata h0=<null hypothesis value>;
   by flag;
   var cost;
run;
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 307 views
  • 3 likes
  • 3 in conversation