Docsity

Biostat 510 Homework 6: Data Analysis using SAS - Prof. Kathleen B. Welch, Assignments of Biostatistics

Toggle sidebar
bg1
Biostat 510
Homework 6
Due Thursday, March 8, 2007
This homework will use the permanent SAS data set (b510.allgroups_merged) that was created
in homework 3. Before proceeding with this homework, be sure this permanent data set was
created properly. If you need the data set, you can download it from my web page.
To do this homework assignment, you will have to submit a libname statement pointing to the
folder where you saved this data set, to let SAS know where the permanent SAS data set is
located. Remember, you only have to submit the libname statement once per SAS session. Your
commands will look something like those shown below:
libname b510 "d:\510\2007\";
1. Create a bivariate scatter plot with PULSE2 as the Y variable and PULSE1 as the X
variable and with separate regression lines for those who ran and those who did not
run.
Note: you will have to exclude the cases which are missing on RAN, using a where
statement in your Proc Gplot commands, such as:
where ran not=.;
Does there appear to be a linear relationship between Pulse1 and Pulse2 for those who
ran? For those who did not run? Do you think the slopes of these two regression lines are
different or the same? (This is just your opinion, before running the regression models).
Include this scatterplot in your write-up. Check out the log and report the two regression
line equations written there.
2. Fit an ANCOVA model, with PULSE2 as the dependent variable, and include RAN,
PULSE1 and the interaction between RAN and PULSE1 (ranXpulse1) as the predictor
variables. To do this, you will have to create the interaction term between RAN (which is
already a dummy variable) and Pulse1, using a new data step, as illustrated below. Save
an output data set with the predicted value, residual, studentized deleted residual, and
Cook’s distance for each observation.
data temp;
set b510.allgroups;
ranXpulse1 = ran*pulse1;
run;
Answer the following questions about your regression output:
a. What is the model R-square?
b. What is the sample size for this regression model?
1
pf3
pf4

Partial preview of the text

Download Biostat 510 Homework 6: Data Analysis using SAS - Prof. Kathleen B. Welch and more Assignments Biostatistics in PDF only on Docsity!

Biostat 510

Homework 6

Due Thursday, March 8, 2007

This homework will use the permanent SAS data set ( b510.allgroups_merged ) that was created in homework 3. Before proceeding with this homework, be sure this permanent data set was created properly. If you need the data set, you can download it from my web page. To do this homework assignment, you will have to submit a libname statement pointing to the folder where you saved this data set, to let SAS know where the permanent SAS data set is located. Remember, you only have to submit the libname statement once per SAS session. Your commands will look something like those shown below: libname b510 "d:\510\2007";

1. Create a bivariate scatter plot with PULSE2 as the Y variable and PULSE1 as the X variable and with separate regression lines for those who ran and those who did not run. Note: you will have to exclude the cases which are missing on RAN, using a where statement in your Proc Gplot commands, such as: where ran not=.; Does there appear to be a linear relationship between Pulse1 and Pulse2 for those who ran? For those who did not run? Do you think the slopes of these two regression lines are different or the same? (This is just your opinion, before running the regression models). Include this scatterplot in your write-up. Check out the log and report the two regression line equations written there.

  1. Fit an ANCOVA model , with PULSE2 as the dependent variable, and include RAN, PULSE1 and the interaction between RAN and PULSE1 (ranXpulse1) as the predictor variables. To do this, you will have to create the interaction term between RAN (which is already a dummy variable) and Pulse1, using a new data step, as illustrated below. Save an output data set with the predicted value, residual, studentized deleted residual, and Cook’s distance for each observation. data temp; set b510.allgroups; ranXpulse1 = ran*pulse1; run; Answer the following questions about your regression output: a. What is the model R-square? b. What is the sample size for this regression model?

c. What are the results of the F-test for this model? Please report the F- statistic, the numerator and denominator degrees of freedom and the p- value. What null hypothesis for this test? d. What is the estimated intercept for this model? Please interpret the intercept estimate. Is it meaningful in the context of the data? e. What is the effect of RAN? Please interpret this parameter estimate. Is it meaningful in the context of the data? f. What is the estimated slope for PULSE1? Interpret the slope estimate for PULSE1 (remember, it is for the reference group of RAN). Is this slope significant? Please report the t-test, degrees of freedom and p-value for the slope. g. What is the estimated effect of the PULSE1 by RAN interaction? Interpret this effect. Is it significant? Please report the t-test, degrees of freedom and p-value for the interaction. h. Write out the estimated equation for the fitted ANCOVA model. i. Write out the estimated regression equation separately those who ran and for those who did not run based on your model fit. What are the estimated intercept and slope for those who ran? For those who did not run? j. Calculate the predicted value of Pulse2 for a student who ran and whose Pulse1 value is equal to 70. Calculate the predicted value of Pulse2 for a student who did not run and whose Pulse1 value is equal to 70. (Do this by hand, and show your work). Get a plot of the Studentized Residuals vs. the Predicted values. Does this plot show any pattern? Are there any apparent outliers? Get a plot of Cook’s Distance vs. the Observation Number. Are there any observations that are particularly influential? Include the regression model output, the plot of studentized residuals vs. predicted values, and the plot of Cook’s distance vs. observation number in your output.

  1. Get a histogram and a normal Q-Q plot of the studentized residuals from your regression model. Include these plots in your homework write-up. Do the residuals appear to be normally distributed? Are there any outliers?
  2. Rerun the model separately for those who ran and those who did not run. Run a regression model with Pulse2 as the dependent variable and Pulse1 as the independent variable for those who ran and those who did not run. Compare the intercept and slope that you got by calculation from your model in question 2 to the values you got by running the regression model separately for each group in this question. Do they agree? They should.
  3. Create Centered Pulse1 (Pulse1_60) and an interaction variable between RAN and Pulse1_60. Go back to your data step and create a new variable, called PULSE1_60 by subtracting 60 from the value of Pulse1 for everyone. Also, create a new interaction variable called RANxPULSE1_60 that is PULSE1_60 times RAN. What does the new variable PULSE1_60 represent? Your data step will look something like the one shown below:
  1. Save your commands as homework6.sas. Include a complete listing of homework6.sas with your homework. Check to make sure that your commands run without errors by submitting them all at once. If there are any errors, fix them and rerun your commands.
  2. Extra Credit : Run an ANCOVA model to predict WEIGHT as a function of FEMALE (you will have to create a dummy variable for FEMALE based on the character variable SEX), HEIGHT, and the interaction between FEMALE and HEIGHT. Center Height at 65 inches before creating the dummy variables and running the model. Interpret the model results. Include the model output in your writeup.