Homework 2 for STA 402/502: Data Analysis of Backache in Pregnancy, Assignments of Statistics

Instructions and data for completing homework assignment 2 in the statistics 402/502 course at carnegie mellon university. Students are required to read in the backache data from a given url, construct relevant variables, generate descriptive statistics, and create plots to analyze trends and relationships in the data.

Typology: Assignments

Pre 2010

Uploaded on 08/19/2009

koofers-user-jqe
koofers-user-jqe 🇺🇸

5

(1)

10 documents

1 / 12

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
STA 402/502 Homework 2
M:\baileraj\Classes\Fall 2007\sta402\hw\Homework-02-08sep08.doc
(*.pdf)
Assigned: 08 Sep. 2008
Due: 15 Sep. 2008
1. Read the backache data from
http://lib.stat.cmu.edu/datasets/backache into SAS. This data
set is also given at the bottom of this page. Note that the order
of the variables in the data set is:
Patient's number
Back pain severity
(values: 0=NILL; 1="nothing worth troubling about";
2="troublesome but not severe"; 3="severe")
Month when pregnancy pain started
Age of patient (years)
Height (m)
Weight (kg) at start of pregnancy
Weight (kg) at end of pregnancy
Weight (kg) of baby
Number of previous pregnancies
Backache with previous pregnancy
(values: 1=not applicable; 2=NO; 3=YES; 4=SEVERE)
Factors relieving backache (8 separate variables with 0=NO; 1=YES)
1 tablets (e.g. aspirin)
2. hot water bottle
3. hot bath
4. Cushion behind back in chair
5. Standing
6. Sitting
7. Lying
8. Walking
Factors aggravating pain (15 separate variables with 0=NO; 1=YES)
1 Fatigue
2. Bending
3. Lifting
4. Making Beds
5. Washing up
6. Ironing
7. A bowel action
8. Intercourse
9. Coughing
10. Sneezing
11. Turning in bed
1
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Homework 2 for STA 402/502: Data Analysis of Backache in Pregnancy and more Assignments Statistics in PDF only on Docsity!

STA 402/502 Homework 2

M:\baileraj\Classes\Fall 2007\sta402\hw\Homework-02-08sep08.doc (*.pdf) Assigned: 08 Sep. 2008 Due: 15 Sep. 2008

  1. Read the backache data from http://lib.stat.cmu.edu/datasets/backache into SAS. This data set is also given at the bottom of this page. Note that the order of the variables in the data set is: Patient's number Back pain severity (values: 0=NILL; 1="nothing worth troubling about"; 2="troublesome but not severe"; 3="severe") Month when pregnancy pain started Age of patient (years) Height (m) Weight (kg) at start of pregnancy Weight (kg) at end of pregnancy Weight (kg) of baby Number of previous pregnancies Backache with previous pregnancy (values: 1=not applicable; 2=NO; 3=YES; 4=SEVERE) Factors relieving backache (8 separate variables with 0=NO; 1=YES) 1 tablets (e.g. aspirin)
  2. hot water bottle
  3. hot bath
  4. Cushion behind back in chair
  5. Standing
  6. Sitting
  7. Lying
  8. Walking Factors aggravating pain (15 separate variables with 0=NO; 1=YES) 1 Fatigue
  9. Bending
  10. Lifting
  11. Making Beds
  12. Washing up
  13. Ironing
  14. A bowel action
  15. Intercourse
  16. Coughing
  17. Sneezing
  18. Turning in bed
  1. Standing
  2. Sitting
  3. Lying
  4. Walking. Use sensible variable names. In addition, use relevant titles for the output.
  5. Construct the body mass index of each woman at the start of the pregnancy. BMI = WT/(HT^2) with WT (kg) and HT (m).
  6. Construct an indicator variable that takes on value=1 if this is the woman does not have a child from a previous pregnancy.
  7. Set up informative labels for all of the variables you input or construct.
  8. Define a new variable which will contain a formatted version of
    • Back pain severity
    • Backache with previous pregnancy
    • Factors relieving backache
    • Factors aggravating pain
  9. Generate a description of your data set using PROC CONTENTS. Include in your solution a listing of the variables, their assigned labels, etc. from this procedure.
  10. Generate a table with the five number summary for all of the numeric variables. Recall that the “5 number summary” includes (min, Q1, M, Q3, max).
  11. Generate a set of plots in which the weight of the baby is plotted on the Y-axis and each of the numeric variables Age of patient (years) Height (m) Weight (kg) at start of pregnancy Weight (kg) at end of pregnancy Weight (kg) of baby Number of previous pregnancies are presented in turn on the X-axis. Try to place this collection of plots on one printed page.
  12. Generate a scatterplot matrix using the Interactive Data Analysis functions in SAS. To do this, select

Backache data from http://lib.stat.cmu.edu/datasets/backache Data file: This data from "Problem-Solving" on "backache in pregnancy" is in somewhat different format from that listed in the book. Each integer is preceded by a space. This makes it easier to read. Each line is split in two separated by an ampersand. Each line also has a full stop (or period) at the end of each line which should be removed. 1 1 0 26 1.52 54.5 75.0 3.35 0 1 0 0 0 0 0 0 0.& 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0. 2 3 0 23 1.60 59.1 68.6 2.22 1 2 1 0 0 1 0 0 0.& 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0. 3 2 6 24 1.57 73.2 82.7 4.15 0 1 0 0 0 1 1 0 1.& 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0. 4 1 8 22 1.52 41.4 47.3 2.81 0 1 0 0 0 0 0 0 0.& 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0. 5 1 0 27 1.60 55.5 60.0 3.75 1 2 0 0 0 0 0 0 0.& 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0. 6 1 7 32 1.75 70.5 85.5 4.01 2 4 0 0 0 0 0 0 0.& 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0. 7 1 0 24 1.73 76.4 89.1 3.41 0 1 0 0 0 0 0 0 0.& 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0. 8 1 8 25 1.63 70.0 85.0 4.01 1 1 0 0 0 1 0 0 0.& 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0. 9 2 6 20 1.55 52.3 59.5 3.69 1 4 0 0 0 0 0 0 1.& 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0. 10 2 8 18 1.63 83.2 90.9 3.30 0 1 1 0 0 0 0 1 0.& 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0. 11 1 0 21 1.65 64.5 75.5 2.95 0 1 0 0 0 0 0 0 0.& 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0. 12 1 0 26 1.55 49.5 53.6 2.64 0 1 1 0 0 0 0 0 0.& 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0. 13 2 6 35 1.65 70.0 82.7 3.64 7 2 0 0 1 0 0 0 0.& 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0. 14 1 8 26 1.60 52.3 64.5 4.49 1 3 0 0 1 1 0 0 0.& 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0. 15 1 6 34 1.68 68.2 77.3 3.75 3 3 0 0 0 1 0 0 1.& 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0. 16 0 0 25 1.50 47.3 55.0 2.73 1 0 0 0 0 0 0 0 0.& 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0. 17 1 7 42 1.52 66.8 73.2 2.44 6 4 0 0 0 1 0 0 0.& 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0.