Docsity

10 Problems on Statistical Computer - Problem Set II | BIOSTAT 510, Assignments of Biostatistics

Toggle sidebar
bg1
Biostat 510
Homework 2
Due Thursday, January 18, 2007
1. Re-import the Excel files from homework 1, Group1.xls – Group8.xls.
2. Combine the Excel files into one permanent SAS data set, called b510.allgroups.
Remember that you have to set up a libname statement to define the library before you
can save the permanent data set.
Be sure you set up the libname statement so your data set will be saved in a location
where you will be able to access it again later from another computer. Your IFS account
is one place where you can store the files, or you can place them on a USB drive, or other
removeable media.
Make sure you set up the missing value codes correctly in the data step. After importing
the Excel files, use commands similar to those shown below to save the permanent SAS
data set:
/*Proc Import commands go before the data step
that combines the Excel files*/
libname b510 "d:\b510\2007";
data b510.allgroups;
set group1
group2
group3
group4
group5
group6
group7
group8;
if distance = -1 then distance = . ;
if weight = 999 then weight = . ;
if sex = "m" then sex = "M";
if sex = "f" then sex = "F";
run;
Make sure you submit the libname statement before running the data step. You should see
something like the following message in your SAS log, indicating that the data set was
successfully created:
102 libname b510 "d:\510\2007";
NOTE: Libref B510 was successfully assigned as follows:
Engine: V9
Physical Name: d:\510\2007
103 data b510.allgroups;
104 set group1
105 group2
106 group3
107 group4
1
pf3

Partial preview of the text

Download 10 Problems on Statistical Computer - Problem Set II | BIOSTAT 510 and more Assignments Biostatistics in PDF only on Docsity!

Biostat 510

Homework 2

Due Thursday, January 18, 2007

1. Re-import the Excel files from homework 1, Group1.xls – Group8.xls. 2. Combine the Excel files into one permanent SAS data set , called b510.allgroups. Remember that you have to set up a libname statement to define the library before you can save the permanent data set. Be sure you set up the libname statement so your data set will be saved in a location where you will be able to access it again later from another computer. Your IFS account is one place where you can store the files, or you can place them on a USB drive, or other removeable media. Make sure you set up the missing value codes correctly in the data step. After importing the Excel files, use commands similar to those shown below to save the permanent SAS data set: /Proc Import commands go before the data step that combines the Excel files/ libname b510 "d:\b510\2007"; data b510.allgroups; set group group group group group group group group8; if distance = -1 then distance =. ; if weight = 999 then weight =. ; if sex = "m" then sex = "M"; if sex = "f" then sex = "F"; run; Make sure you submit the libname statement before running the data step. You should see something like the following message in your SAS log, indicating that the data set was successfully created: 102 libname b510 "d:\510\2007"; NOTE: Libref B510 was successfully assigned as follows: Engine: V Physical Name: d:\510
103 data b510.allgroups; 104 set group 105 group 106 group 107 group

108 group 109 group 110 group 111 group8; 112 113 if distance = -1 then distance =. ; 114 if weight = 999 then weight =. ; 115 116 if sex = "m" then sex = "M"; 117 if sex = "f" then sex = "F"; 118 119 run; NOTE: There were 8 observations read from the data set WORK.GROUP1. NOTE: There were 8 observations read from the data set WORK.GROUP2. NOTE: There were 9 observations read from the data set WORK.GROUP3. NOTE: There were 11 observations read from the data set WORK.GROUP4. NOTE: There were 13 observations read from the data set WORK.GROUP5. NOTE: There were 10 observations read from the data set WORK.GROUP6. NOTE: There were 10 observations read from the data set WORK.GROUP7. NOTE: There were 6 observations read from the data set WORK.GROUP8. NOTE: The data set B510.ALLGROUPS has 75 observations and 11 variables.

3. Create new variables in your permanent data set. a) PULSEDIFF, which is calculated by subtracting pulse1 from pulse2. b) BMI. BMI = Weight in kilograms / height in meters-squared Be sure that you convert height in inches to height in meters, and weight in kilograms to weight in pounds when you calculate bmi. The range of BMI values should be from about 15 to 35. The conversion formulas are: Height in centimeters = 2.54 times height in inches Height in meters = height in centimeters / 100 Weight in kilograms = 0.454 times weight in pounds Your commands to create the new variables will look something like those below. Remember, you need to add these commands to your data step commands, and resubmit them, so the data set will get recreated, and the new variables will be added to it. pulsediff = pulse2 - pulse1; bmi = (weight * .454)/((height2.54)/100)*2 ; 4. Use Proc Univariate to get the distribution of AGE, PULSE1, PULSE2, PULSEDIFF, and BMI. Create a histogram for each of these continuous variables. Include the histograms in your homework assignment. Describe these distributions in terms of their skewness, and in terms of outliers. 5. Get descriptive statistics for all numeric variables in your new data set for those who RAN and for those who did not run. Include these descriptive statistics in your homework write-up. You can either use a class statement, or you can sort first, and use a by statement for this output. 6. Make a side-by-side boxplot of PULSE1, PULSE2, and PULSEDIFF using RAN as the X-axis variable. Include these three boxplots in your homework write-up. (You can resize them so they don’t take up much room). Don’t forget to sort by RAN before running the boxplots. How do these variables compare visually for those who ran and those who did not run? Discuss the boxplots in terms of central tendency (mean and median) and in terms of spread (the whiskers) and outliers for the two groups. Explain why these differ,