Base SAS Flashcards

1
Q

What is the basic structure of the SAS base program?

A

DATA step, which recovers & manipulates data.

PROC step, which interprets the data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the basic syntax style in SAS?

A
  • There should be a semi-colon at the end of every line
  • A data statement that defines your data set
  • Input statement
  • There should be at least one space between each word or statement
  • A run statement
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain data step in SAS

A

The Data step creates a SAS dataset which carries the data along with a “data dictionary.” The data dictionary holds information about the variables and their properties.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the data types does SAS contain?

A

The data types in SAS are Numeric and Character.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which statement does not perform automatic conversions in comparisons?

A

In SAS, the “where” statement does not perform automatic conversions in comparisons.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a method to debug and test your SAS program?

A

This combination of options tells SAS to execute the step and analyze the syntax of your code without reading any input data.
options OBS=0 NOREPLACE;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the difference between nodupkey and nodup options?

A

The difference between the NODUP and NODUPKEY is that NODUP compares all the variables in our dataset while NODUPKEY compares just the BY variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does PROC print, and PROC contents do?

A

To display the contents of the SAS dataset PROC print is used and also to assure that the data were read into SAS correctly. While PROC CONTENTS display information about a SAS dataset.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the use of function Proc summary?

A

The syntax of proc summary is the same as that of proc means. It computes descriptive statistics on numeric variables in the SAS dataset.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What Proc glm does?

A

Proc glm performs simple and multiple regression, analysis of variance (ANOVAL), analysis of covariance, multivariate analysis of variance and repeated measure analysis of variance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is SAS informats?

A

SAS INFORMATS are used to read, or input data from external files known as Flat Files ASCII files, text files or sequential files). The informat will tell SAS on how to read data into SAS variables.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Name types of category in which SAS Informats are placed

A

Character Informats : $INFORMATw
Numeric Informats : INFORMAT w.d
Date/Time Informats: INFORMAT w.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the use of PROC gplot?

A

PROC gplot has more options and can create more colorful and fancier graphics.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the difference between INPUT and INFILE ?

A

INFILE statement is used to identify an external file

INPUT statement is used to describe your variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

State the difference between INFORMAT and FORMAT ?

A

INFORMAT: To indicate SAS how to read data into a dataset.
FORMAT: To indicate SAS how to print the variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How you can read the variables that you need?

A

You read the variables using input statement with column /line pointers, informats and length specifiers.

17
Q

What are the special input delimiters used in SAS?

A

Special input delimiters used in SAS are DLM and DSD

18
Q

How to include or exclude specific variables in a data set?

A

To include or exclude specific variables in a data set you can use DROP, KEEP Statements and Data set Options.

19
Q

What is the difference between SAS functions and procedures?

A

Procedures expect one variable value per observation

Functions expect values to be supplied across an observation

20
Q

What are the default statistics that PROC MEANS produce?

A
N
MN
MAX
MEAN
STD DEV
21
Q

What is the difference between Match Merge and One to One Merge?

A

A one-to-one merge is suitable if both data sets in the merge statement are sorted by id, and each observation in one data set has a corresponding observation in the other data set. If the observations do not match, then match merging is suitable.

22
Q

What is the use of the %include statement?

A

%INCLUDE statement reads an entire file into the current SAS program you are running and submits that file to the SAS System immediately.

23
Q

What does the trace option do?

A

ODS Trace is used to find the names of the particular output objects when several of them are created by some procedure.

24
Q

How would you identify a macro variable?

A

with Ampersand (&) sign

25
Q

How would you define the end of a macro?

A

The end of the macro is defined by %Mend Statement

26
Q

What is the difference between %LOCAL and %GLOBAL?

A

% Local is a macro variable defined inside a macro. %Global is a macro variable defined in open code (outside the macro or can use anywhere).

27
Q

What do you understand by the term Normal Distribution?

A

data is distributed around a central value without any bias to the left or right and reaches normal distribution in the form of a bell-shaped curve. The random variables are distributed in the form of a symmetrical bell-shaped curve.

28
Q

What does P-value signify about the statistical data?

A

P-value is used to determine the significance of results after a hypothesis test in statistics. P-value helps the readers to draw conclusions and is always between 0 and 1. The probability of obtaining test results at least as extreme as the results that are actually observed.

29
Q

Difference between sum function and using “+” operator?

A

SUM function returns the sum of non-missing arguments. ‘+’ operator returns a missing value if any of the arguments are missing.

30
Q

What is %LET?

A

%LET is a straightforward macro statement that simply assigns a value to a macro variable.

31
Q

How to begin a macro?

A

%MACRO

32
Q

What is regression analysis?

A

Predict a value of the Y variable given known values of the X variable.