04-07-2015 11:07 PM
I am struggling with coding with following questions:
I need to find difference between male and female from dataset and find significance between male and female.
First, should I subset or split dataset?
There are variables for each male and female so I think I need to create a new variable with add number of variables.
What is a code to get significance between male and female?
Please help me,
04-08-2015 09:13 AM
You shouldn't need to split your dataset, SAS does by group processing so just use gender as a by or class variable. E.g.
proc sort data=sashelp.classfit out=tmp;
proc means data=tmp noprint;
output out=myres n=n mean=mean stddev=stddev min=min max=max;
This will give you means results by sex from the sashelp table.
As for significance, not sure, your best off posting that question in Statistical Procedures sub forum.
04-08-2015 09:20 AM
The first record is the stats for ALL observations, and the next two records are for F and M, respectively.
04-08-2015 10:16 AM
If you only need to analyze one variable, you could get everything you want by running proc ttest. e.g.:
proc ttest data=sashelp.class;
04-08-2015 11:19 AM
... IF (big if) your data has a normal distribution. Otherwise, or instead, since there is not is not much power lost, go for non-parametric analyses :
proc npar1way data=sashelp.class Wilcoxon;