The data (bloodpressure) gives the systolic blood pressure (SBP), body size (QUE
ID: 3178831 • Letter: T
Question
The data (bloodpressure) gives the systolic blood pressure (SBP), body size (QUET), age and smoking history (SMK=0 if nonsmoker, SMK=1 if smoker) for a hypothetical sample of 32 white males over 40 years old from the town of Angina. In the problem, we will choose SBP as the response. The two variables QUET and SMK will be considered. Answer the following questions about the separate straight-line regression of SBP on QUET for smokers (SMK=1) and nonsmoker (SMK=0). The data has columns as: id SBP QUET age SMK. Can you code in R?
a.) Set up regression models for SBY (Y) on QUET (X) separately for smokers and nonsmokers.
b.) Using SAS to estimate the models. Report your regression lines. Provide a scatter plot with regression lines.
DATA SET:
1 135 2.876 45 0
2 122 3.251 41 0
3 130 3.100 49 0
4 148 3.768 52 0
5 146 2.979 54 1
6 129 2.790 47 1
7 162 3.668 60 1
8 160 3.612 48 1
9 144 2.368 44 1
10 180 4.637 64 1
11 166 3.877 59 1
12 138 4.032 51 1
13 152 4.116 64 0
14 138 3.673 56 0
15 140 3.562 54 1
16 134 2.998 50 1
17 145 3.360 49 1
18 142 3.024 46 1
19 135 3.171 57 0
20 142 3.401 56 0
21 150 3.628 56 1
22 144 3.751 58 0
23 137 3.296 53 0
24 132 3.210 50 0
25 149 3.301 54 1
26 132 3.017 48 1
27 120 2.789 43 0
28 126 2.956 43 1
29 161 3.800 63 0
30 170 4.132 63 1
31 152 3.962 62 0
32 164 4.010 65 0
Explanation / Answer
Set up regression models for SBY (Y) on QUET (X) separately for smokers and nonsmokers.
regression models for SBY (Y) on QUET (X) for nonsmokers.
regression models for SBY (Y) on QUET (X) for nonsmokers is Y=49.3117+26.3028X
regression models for SBY (Y) on QUET (X) for smokers.
regression models for SBY (Y) on QUET (X) for smokers is Y=79.2553+20.1180X
QUET SBY 2.876 135 3.251 122 3.1 130 3.768 148 4.116 152 3.673 138 3.171 135 3.401 142 3.751 144 3.296 137 3.21 132 2.789 120 3.8 161 3.962 152 4.01 164Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.