Dataset and its variables

We will use the birthwt dataset from the MASS library in R.

# variable name variable label coded levels
1 low indicator of birth weight less than 2.5 kg 0, 1
2 age mother’s age in years continuous variable
3 lwt mother’s weight in pounds at last menstrual period continuous variable
4 race mother’s race (1 = white, 2 = black, 3 = other) 1, 2, 3
5 smoke smoking status during pregnancy 0, 1
6 ptl number of previous premature labours 0, 1, 2, 3
7 ht history of hypertension 0, 1
8 ui presence of uterine irritability 0, 1
9 ftv number of physician visits during the first trimester 0, 1, 2, 3, 4, 6
10 bwt birth weight in grams continuous variable

Import the dataset

%let path=/folders/myfolders/birthwt;
SAS Connection established. Subprocess id is 2929

<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”>

34   ods listing close;ods html5 (id=saspy_internal) file=stdout options(bitmap_mode='inline') device=svg style=HTMLBlue; ods
34 ! graphics on / outputfmt=png;
NOTE: Writing HTML5(SASPY_INTERNAL) Body file: STDOUT
35
36 %let path=/folders/myfolders/birthwt;
37
38 ods html5 (id=saspy_internal) close;ods listing;

39
proc import datafile="&path/birthwt.csv" out=ibwt dbms=csv replace;

<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”>

49   ods listing close;ods html5 (id=saspy_internal) file=stdout options(bitmap_mode='inline') device=svg style=HTMLBlue; ods
49 ! graphics on / outputfmt=png;
NOTE: Writing HTML5(SASPY_INTERNAL) Body file: STDOUT
50
51 proc import datafile="&path/birthwt.csv" out=ibwt dbms=csv replace;
52
53 ods html5 (id=saspy_internal) close;ods listing;

54

Describe and display its contents

proc contents data=ibwt varnum;
run;
<!DOCTYPE html> SAS Output

The SAS System

The CONTENTS Procedure

Data Set Name WORK.IBWT Observations 189
Member Type DATA Variables 10
Engine V9 Indexes 0
Created 10/14/2019 21:04:41 Observation Length 80
Last Modified 10/14/2019 21:04:41 Deleted Observations 0
Protection   Compressed NO
Data Set Type   Sorted NO
Label      
Data Representation SOLARIS_X86_64, LINUX_X86_64, ALPHA_TRU64, LINUX_IA64    
Encoding utf-8 Unicode (UTF-8)    
Engine/Host Dependent Information
Data Set Page Size 65536
Number of Data Set Pages 1
First Data Page 1
Max Obs per Page 817
Obs in First Data Page 189
Number of Data Set Repairs 0
Filename /tmp/SAS_work2F0900000E52_localhost.localdomain/ibwt.sas7bdat
Release Created 9.0401M6
Host Created Linux
Inode Number 671803
Access Permission rw-r–r–
Owner Name sasdemo
File Size 128KB
File Size (bytes) 131072
Variables in Creation Order
# Variable Type Len Format Informat
1 low Num 8 BEST12. BEST32.
2 age Num 8 BEST12. BEST32.
3 lwt Num 8 BEST12. BEST32.
4 race Num 8 BEST12. BEST32.
5 smoke Num 8 BEST12. BEST32.
6 ptl Num 8 BEST12. BEST32.
7 ht Num 8 BEST12. BEST32.
8 ui Num 8 BEST12. BEST32.
9 ftv Num 8 BEST12. BEST32.
10 bwt Num 8 BEST12. BEST32.
proc print data=ibwt (obs=5);
run;
<!DOCTYPE html> SAS Output

The SAS System

Obs low age lwt race smoke ptl ht ui ftv bwt
1 0 19 182 2 0 0 0 1 0 2523
2 0 33 155 3 0 0 0 0 3 2551
3 0 20 105 1 1 0 0 0 1 2557
4 0 21 108 1 1 0 0 1 2 2594
5 0 18 107 1 1 0 0 1 0 2600

Summary statistics for continuous variables

proc means data=ibwt maxdec=2;
var age lwt bwt;
run;
<!DOCTYPE html> SAS Output

The SAS System

The MEANS Procedure

Variable N Mean Std Dev Minimum Maximum
age
lwt
bwt
189
189
189
23.24
129.81
2944.59
5.30
30.58
729.21
14.00
80.00
709.00
45.00
250.00
4990.00

One-way frequency tables for categorical variables

proc freq data=ibwt;
tables low race smoke ptl ht ui ftv/nocumfreq nocumpercent nopercent;
run;
<!DOCTYPE html> SAS Output

The SAS System

The FREQ Procedure

low Frequency
0 130
1 59
race Frequency
1 96
2 26
3 67
smoke Frequency
0 115
1 74
ptl Frequency
0 159
1 24
2 5
3 1
ht Frequency
0 177
1 12
ui Frequency
0 161
1 28
ftv Frequency
0 100
1 47
2 30
3 7
4 4
6 1