Statistical Consulting Center - UMass AMherst
 

Home
Site Licenses
Computer Labs
OITUNIX
Direct Purchase
Discounts

Statistical Software
Instructional Materials

What's New
Current Releases
Patches
Downloads


Resources
Documentation
Consulting
Software Developers' Links
"Third Party" Learning and Data Resources

BCCUMA

Datasets

Workshops

Online Docs
SAS 8.2
SAS 9.1.3
SIR 2002
S-PLUS

 

Statistical Software > SAS II > Self-Assessment Test

SAS Workshop Placement Self-Assessment Test

Doing the following exercise will help you decide which SAS workshop is appropriate for you. If you have a lot of difficulty doing these tasks, or need a great deal of help to do them, sign up for the SAS I - Introduction class. If you can do these tasks with little or no help, you are ready for the SAS II - Data Management class.

The file lowbwt2.dat contains data on 189 subjects. Eight variables were measured on each subject to help identify risk factors associated with giving birth to a baby with low birth weight (weighing <2500 grams).

NOTE: These data come from Hosmer and Lemeshow (2000) Applied Logistic Regression: Second Edition. These data are copyrighted by John Wiley & Sons Inc. and must be acknowledged and used accordingly. For purposes of this exercise, a few missing data points have been introduced.

First, download the datafile. Click on lowbwt2.dat, then choose Save As on the File menu.

The file contains the following information for each subject:

  • Identification Code
  • Low Birth Weight (0 = birth weight ge 2500g, 1=birth weight < 2500g)
  • Mother's Age (in years, 0 indicates missing value)
  • Mother's weight at last menstrual period (in lbs, 999 indicates missing value)
  • Race (1=White, 2=Black, 3=Other)
  • Smoking Status During Pregnancy (1=Yes, 0=No)
  • History of Premature Labor (0=None, 1=One, etc.)
  • History of Hypertension (1=Yes, 0=No)
  • Presence of Uterine Irritability (1=Yes, 0=No)
  • Number of Physician Visits during the First Trimester (0=None, 1=One, etc.)
  • Birth Weight (in grams, 0 indicates missing value)
1. Read the lowbwt2.dat data file into a temporary SAS dataset. Choose appropriate names for the variables, and use SAS statements to change the missing value codes in the data into SAS missing values.

2. Run Proc Freq or Proc Means on each variable, as appropriate. (i.e. choose the appropriate procedure for each variable.)

3. Look at the output and check that all results are reasonable, and that missing values have been handled properly.

4. Save the sas code that you used to do the above steps.

5. Make this a permanent SAS dataset.

6. Exit SAS.

7. In a new SAS session, run Proc Means on the permanent SAS dataset, to compare the mean birth weight of mothers who smoked or didn't smoke. (i.e. run Proc Means on birth weight, using the smoking status variable as a CLASS variable.)

8. Create a new variable "Visits" which is 0 when there were no physician visits during the first trimester, and 1 for 1 or more visits.  Make the modified dataset a permanent SAS dataset.

9. Select the subjects who did not visit a physician during the first trimester (Visits=0), and run Proc Means for these subjects, comparing the babies' birthweights for smokers and non-smokers.

10. Repeat using the subjects who did visit a physician during the first trimester (Visits=1).

11. Interpret the results. Are they reasonable?


 

 

   


© 2004 University of Massachusetts Amherst. Site Policies.