Week2 Flashcards

1
Q

What are some system options?

A

Nodate
Nocenter
Center
OBS =n|min|max - limit the number of observations read by sas
Firstobs = where you want to start
LS-line size or number of columns
Ps- page size or number of rows
Pageno =1

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

Global statements

A

Sets values and attributes for all output created after global statement specified. I will stay until overridden.

Examples: TITLE, OPTIONS, FOOTNOTE

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

OBS

A

OBS= #of obs
OBS=max
FIRSTOBS=

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

Creating and redefining variables

A

New variable = old variable expression
Can use numeric operators
EQ, NE, LT, GT, LE, GE

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

Property use of listing index variables with OF

A

(X1+x2+x3)
SUM(x1, x2, x3)
Sum(OF x1 x2 x3)
Sum(OF x1-x3)
Sum(OF x1- -y1) different indexes
You don’t need commas after OF

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

Functions

A

Sum, mean, sqrt, abs, upcase, lowcase, int, round, floor, ceil, log, log10

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

SUBSTR

A

Used to pars a character string from a character variable.
SUBSTR(charvar, initial position, total characters)
PHONE=(502) 852-2222
AREA = SUBSTR(PHONE, 2, 3)

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

Common statement options

A

Label, keep, drop, rename, position

DATA dataset (option= x)
Set data (rename=(old=new);

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

PROC SORT

A

Use BY statement and list variable
Good to use an OUT statement
Auto is ascending

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

Removing duplicates

A

NODUP- used in statement option in proxy removes unwanted duplicates
Uses BY_ALL_ it removes fully duplicated observations

NODUPKEY remove partially duplicated observations of the BY variable

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

Combining data

A

Concatenation: SET data1 data2
interleaving: SET data1 data2
BY var
Best use when both data sets have the same variables, but not the same records
Merging

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

Simple merges

A

Unmatched merge – ation from two or more data sets are combined, one to one
Matched merge - matching values of BY variables
Sort first!
UPdATE

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

IN

A

The in option creates a variable indicating what data sets contribute to forming the observation in the final data set. gets the value of one if it did in zero if it did not.
IN=A IN=B
IF A=B if A and B are in both data sets
IF=B leaves out nonmatching records from A

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