Docsity

Biostat 510 Homework 2: Statistical Analysis of Heart Rate Data - Prof. Kathleen B. Welch, Assignments of Biostatistics

Toggle sidebar
bg1
Biostat 510: Statistical Computing Packages
SAS Homework 2
Due Tuesday, January 22, 2004
1. Get the contents of your data set created for homework 1. Use the varnum option
so that the variable list will be in the order the variables appear in the data set.
You will need to submit a libname statement first, so that you can use your data
set from homework 1. How many variables are in your data set? How many are
numeric? How many are character? How many observations are in the data set?
What is the physical file name of your data set? What engine was used to create
this data set?
libname b510 V8 "c:\temp\b510";
proc contents data=b510.hrtrate2 varnum;
run;
2. Heartrate: paired t-test:
a. Using Proc Univariate, get descriptive statistics and the distribution for
PULSE1 and PULSE2. Get a histogram using the Histogram statement in
proc univariate. Save your histograms as files, (use type=emf). Include the
histograms in your homework document (you can resize them so that they
will both fit on one page). How would you describe the distribution of
these two variables. What is are there mean, sample size and standard
deviation?
b. Carry out a paired t-test comparing PULSE1 to PULSE2. What are your
null and alternative hypotheses? What is the value of the test statistic? The
degrees of freedom? The p-value? What do you conclude about the means
of these two variables?
3. Hrdiff: one-sample t-test:
a. Calculate a new variable by subtracting Pulse1 from Pulse2. To do this,
you will need to create a new temporary data set.
data hrtrate3;
set b510.hrtrate2;
hrdiff = pulse2-pulse1;
run;
b. Calculate a one-sample t-test to test the null hypothesis that the mean of
hrdiff=0, using any of the methods shown in the handout. Write out your
null and alternative hypotheses. Report the test statistic, the degrees of
freedom and the p-value. What do you conclude about the mean of hrdiff?
4. Heartrate: paired t-test for those who ran and those who did not run:
a. Get descriptive statistics for all variables in your data set separately for
those who ran and those who did not run. You must first sort the data set
by RAN, and then get the descriptive statistics by RAN.
1
pf2

Partial preview of the text

Download Biostat 510 Homework 2: Statistical Analysis of Heart Rate Data - Prof. Kathleen B. Welch and more Assignments Biostatistics in PDF only on Docsity!

Biostat 510: Statistical Computing Packages

SAS Homework 2

Due Tuesday, January 22, 2004

  1. Get the contents of your data set created for homework 1. Use the varnum option so that the variable list will be in the order the variables appear in the data set. You will need to submit a libname statement first, so that you can use your data set from homework 1. How many variables are in your data set? How many are numeric? How many are character? How many observations are in the data set? What is the physical file name of your data set? What engine was used to create this data set? libname b510 V8 "c:\temp\b510"; proc contents data=b510.hrtrate2 varnum; run;
  2. Heartrate: paired t-test: a. Using Proc Univariate, get descriptive statistics and the distribution for PULSE1 and PULSE2. Get a histogram using the Histogram statement in proc univariate. Save your histograms as files, (use type=emf). Include the histograms in your homework document (you can resize them so that they will both fit on one page). How would you describe the distribution of these two variables. What is are there mean, sample size and standard deviation? b. Carry out a paired t-test comparing PULSE1 to PULSE2. What are your null and alternative hypotheses? What is the value of the test statistic? The degrees of freedom? The p-value? What do you conclude about the means of these two variables?
  3. Hrdiff: one-sample t-test: a. Calculate a new variable by subtracting Pulse1 from Pulse2. To do this, you will need to create a new temporary data set. data hrtrate3; set b510.hrtrate2; hrdiff = pulse2-pulse1; run; b. Calculate a one-sample t-test to test the null hypothesis that the mean of hrdiff=0, using any of the methods shown in the handout. Write out your null and alternative hypotheses. Report the test statistic, the degrees of freedom and the p-value. What do you conclude about the mean of hrdiff?
  4. Heartrate: paired t-test for those who ran and those who did not run: a. Get descriptive statistics for all variables in your data set separately for those who ran and those who did not run. You must first sort the data set by RAN, and then get the descriptive statistics by RAN. 1

proc sort data=hrtrate3; by ran; run; b. Carry out a separate paired t-test comparing PULSE1 to PULSE2 for those who ran and those who did not run. To do this you will again need to use the By Ran; statement, but you will not need to sort your data set again. What do you conclude about the means of these two variables for those who ran and those who did not run? c. Include the results of these tests in your write-up (include the test statistic, the degrees of freedom and the p-value). d. Interpret your results.

  1. Hrdiff: one-sample t-test for hrdiff for those who ran and those who did not run. a. Carry out a one-sample t-test to test the null hypothesis that the mean of Hrdiff=0 separately for those who ran and those who did not run. b. Report and interpret your results.
  2. Pulse1, Pulse2, and Hrdiff:: independent samples t-tests: a. Open up SAS/INSIGHT. Get a side-by-side box-plot of Pulse1, Pulse and Hrdiff for those who ran and did not run. (Use the Box Plot menu. RAN will be the X variable and Pulse1, Pulse2 and Hrdiff will be the Y variables.) Include these graph in your homework. b. Carry out independent samples t-tests to compare Pulse1, Pulse2 and Hrdiff for those who ran vs. those who did not run. What are your null and alternative hypotheses for comparison of these means? What is the value of the F-statistic to compare the variances for each variable? (Give the result of the F-statistic, the numerator and denominator degrees of freedom and the p-value.) Based on the result of the F-statistics, which t- test will you use for each variable? Give the results of the t-tests. Justify which independent samples t-test you chose to use. c. Interpret your results.
  3. BMI: independent samples t-test. a. Open your data set in SAS/INSIGHT. Get a boxplot for BMI, for males and females side-by-side on the same graph. Include this graph in your write-up. b. Carry out an independent samples t-test to compare BMI for males vs. females. What are your null and alternative hypotheses? Based on the value of the F-test for equal variances, which t-test should you use? For the t-test, what are your test statistic, df, p-value? What do you conclude about the mean value of BMI for males vs. females?
  4. Create a new permanent SAS data set called b510.hrtrate3 from your temporary data set.
  5. Be sure all of your commands will run without any errors. Turn in your SAS commands on a separate sheet, along with your homework. 2