Few coding questions for a beginner

#1
I was wondering how to select for a few given variables per say. So like average weight of blonde women compared to average weight of brunette men. I know how to specify a given variable such as haircolor and gender by not exacts. I thank you very much for your help
 

noetsi

Fortran must die
#2
You will find there are many many ways to do anything in sas. I am not sure what you want to do exactly. If you want to compare the mean of weight by different hair colors this will do that. Use PROC MEANS with a class variable that shows hair color and gender (it has to be in one variable not several). Another way is to use PROC SQL to select blond women and brunette men (separately) and then do PROC MEANS on these.

PROC MEANS DATA=WORK.yourdata
FW=12
PRINTALLTYPES
CHARTYPE
NWAY
VARDEF=DF
MEAN
STD
MIN
MAX
N ;
VAR variableyouwanttoanalyze ;
CLASS blondorbrun / ORDER=UNFORMATTED ASCENDING;

You can leave the VF and VARDEF blank I think, these are defaults I use in enterprise guide (which is the easiest way to do this).
 

noetsi

Fortran must die
#4
It would just be
PROC SQL;
Create table work.example
as SELECT (Mean weightvariable)
Where gender= 'Female'
And haircolor ='Blond';
Quit;

Then do the same thing for brunette men.

Obviously the where statement would depend on what words were used to define gender and haircolor.