Exam 1 Flashcards
Types of variables and their definitions
Continuous: variable value can be measured along a numerical continuum (height, weight)
Categorical: variable value form category, either unordered (0 for male and 1 for female) or ordered (0 for low, 1 for medium, and 2 for high).
Define observation
A set of data values for the same subject (name, age, height, weight, gender of one subject).
Define a SAS data set:
a collection of observations
Define a SAS statement
a command instructing SAS to perform certain action
Define a SAS program
a set of SAS statements designed to perform a specific task
List and define the four windows in SAS
Program (editor) window: This is where the program is written, edited and submitted.
Log window: It records the submitted program, including warnings and error message.
Output window: LISTING output from the submitted program. This is the default in SAS 9.2 and earlier versions.
Results Viewer: HTML output from the submitted program. This is the default in SAS 9.3.
How to type in data?
DATA temp; Input \_\_\_\_ \_\_\_\_ \_\_\_\_ ect ; datalines; (or cards;) . . . .
;
run;
How to indicate that a variable is a character in SAS
in the input line type the name of the variable $
How to print the results
proc print data=___ (obs=___); run;
note: only type the (obs=___) part if you are trying to print the first ___ observations
List the naming conventions
SAS program: use extension ‘.sas’
SAS log: use extension ‘.log’
SAS output: use extension ‘.out’
Results Viewer: use extension ‘.mht’
What are the 7 descriptive statistic commands (from section 1) in SAS?
proc contents
proc means
proc univariate
proc freq
proc corr
proc plot
proc gchart
How is the descriptive statistic command “proc contents” command written and what does it do?
proc contents data=___ ; run;
(Tells us the number of observations, Variables, Indexes, Observation length, Deleted observations, and if its compressed or sorted. Also use this to find out how the data is coded. Is it numerical or something else? The variable name and the #s must be the same code.)
How is the descriptive statistic command “proc means” command written and what does it do?
proc means data=___; run;
Gives us the means, Std Dev, Minimum, and Maximum for the variables
How is the descriptive statistic command “proc univariate” command written and what does it do?
proc univariate data=___;
var ___;
run;
(the var ___ specifies which variable you are interested in. The command gives us the statistics for that specific variable.)
How is the descriptive statistic command “proc freq” command written and what does it do?
proc freq data=___;
tables ____;
run;
(gives a frequency table of the selected variable. The columns in the table include: variable observation number, frequency, percent, cumulative frequency, and cumulative percent).