Module 8 Producing Descriptive Statistics Flashcards
What is proc means?
Gets us basic statistics for numeric values
Proc means options
maxdec, max, min, mean, mode, N, NMISS, range, stdev, sum, etc
optional VARS statement
specified which numeric variables to use in the analysis
optional BY statement
performs a separate analysis for each level of variables in the list
what must we do before using BY?
SORT THE DATA!
optional CLASS statement
separate analysis for each level but no sorting needed
optional TYPES statement
specifies a combination of CLASS variables
optional TABLES statement
calculates frequencies, crosstabulation with *, all vars used in tables must be in the class statement
What does () do in type statement?
gives the descriptive statistic required across all observations in the data set
OUTPUT OUT syntax
OUTPUT OUT = data-set statistic(variable-list) = name-list
value of TYPE
depends on the level of interaction.
The observation where TYPE has a value of zero is the grand total.
Practice: Frequencies for the variables rank, grade, race, and gender
proc freq data = one;
tables rank grade race gender/ list missing;
run;
Frequencies on all CHARACTER variables in the data set;
proc freq data=one;
tables character/ list missing;
run;
one way PROC FREQ options
Must include / in the TABLES statement
LIST: display counts in list format;
MISSING: includes missing values in frequencies and percentages;
NOCUM: suppresses cumulative frequencies;
NOPERCENT: suppresses printing of percentages;
OUT = dataset: writes out a data set containing frequencies
two-way PROC FREQ options
CROSSLIST: displays crosstabulations in list forat with totals
NOCOL: suppresses column perentages;
NOROW: suppresses row percentages