I need help with the R code and interpretation for the following question: Two w
ID: 3053297 • Letter: I
Question
I need help with the R code and interpretation for the following question:
Two way ANOVA with interaction
Researchers have collected the data in “Tbl12_4 SBP2.xlsx”. The outcome variable (typically a dependent variable) of interest is SBP (systolic blood pressure) and it is numerical. Other variables (they can be your independent variables of interest) are Age_gp (defined as a categorical variable with 4 age levels defined as 1=teenage, 2=young, 3=mid age, 4=senior), SMK (current/previous smoking status with 1= smoker and 0=not), QUET (quetelet index, a measure of body size and a numerical variable).
(1A) If your research question of interest is to compare SBP between smokers and non-smokers in each of Age group, can you write down the hypothesis for this study (Hint, for example, you can define M1s as population mean of SBP for smokers in Age group1, and M1n= population mean of SBP for non-smokers in Age group1, then the hypothesis can be written in the following:
HT: M1s=M1n; ?=?; ?=?; and ?=? (try to fill the ?’s by yourself by defining population means in other categories/groups to complete the hypothesis).
(1B) What is an appropriate statistical model to address the hypothesis in (1A)? (Be specific of your dependent variable, and all independent variables. A writing model with explanation of notations is preferred.)
(1C) List sample means +/- SE (standard error) of SBP in each smoking status in each age group .
(1D) Address the HT by adding the p-values in the Table in (1C). Make sure you use a multiple correction method in comparisons.
Person SBP QUET SMK Age_GP D1 D2 D3 D4 D1X D2X D3X D4X 1 120 2.789 0 1 1 0 0 0 2.789 0 0 0 2 152 4.116 0 4 0 0 0 1 0 0 0 4.116 3 135 3.171 0 3 0 0 1 0 0 0 3.171 0 4 180 4.637 1 4 0 0 0 1 0 0 0 4.637 5 137 3.296 0 2 0 1 0 0 0 3.296 0 0 6 162 3.668 1 4 0 0 0 1 0 0 0 3.668 7 130 3.1 0 2 0 1 0 0 0 3.1 0 0 8 162 3.668 1 4 0 0 0 1 0 0 0 3.668 9 122 3.251 0 1 1 0 0 0 3.251 0 0 0 10 132 3.21 0 2 0 1 0 0 0 3.21 0 0 11 138 3.673 0 3 0 0 1 0 0 0 3.673 0 12 180 4.637 1 4 0 0 0 1 0 0 0 4.637 13 135 2.876 0 1 1 0 0 0 2.876 0 0 0 14 137 3.296 0 2 0 1 0 0 0 3.296 0 0 15 120 2.789 0 1 1 0 0 0 2.789 0 0 0 16 149 3.301 1 3 0 0 1 0 0 0 3.301 0 17 145 3.36 1 2 0 1 0 0 0 3.36 0 0 18 161 3.8 0 4 0 0 0 1 0 0 0 3.8 19 122 3.251 0 1 1 0 0 0 3.251 0 0 0 20 145 3.36 1 2 0 1 0 0 0 3.36 0 0 21 144 3.751 0 3 0 0 1 0 0 0 3.751 0 22 140 3.562 1 3 0 0 1 0 0 0 3.562 0 23 132 3.017 1 2 0 1 0 0 0 3.017 0 0 24 164 4.01 0 4 0 0 0 1 0 0 0 4.01 25 152 3.962 0 4 0 0 0 1 0 0 0 3.962 26 135 2.876 0 1 1 0 0 0 2.876 0 0 0 27 126 2.956 1 1 1 0 0 0 2.956 0 0 0 28 150 3.628 1 3 0 0 1 0 0 0 3.628 0 29 148 3.768 0 2 0 1 0 0 0 3.768 0 0 30 135 3.171 0 3 0 0 1 0 0 0 3.171 0 31 152 4.116 0 4 0 0 0 1 0 0 0 4.116 32 152 3.962 0 4 0 0 0 1 0 0 0 3.962 33 146 2.979 1 3 0 0 1 0 0 0 2.979 0 34 138 4.032 1 2 0 1 0 0 0 4.032 0 0 35 144 2.368 1 1 1 0 0 0 2.368 0 0 0 36 160 3.612 1 2 0 1 0 0 0 3.612 0 0 37 142 3.401 0 3 0 0 1 0 0 0 3.401 0 38 140 3.562 1 3 0 0 1 0 0 0 3.562 0 39 144 2.368 1 1 1 0 0 0 2.368 0 0 0 40 142 3.024 1 1 1 0 0 0 3.024 0 0 0 41 142 3.401 0 3 0 0 1 0 0 0 3.401 0 42 161 3.8 0 4 0 0 0 1 0 0 0 3.8 43 130 3.1 0 2 0 1 0 0 0 3.1 0 0 44 144 3.751 0 3 0 0 1 0 0 0 3.751 0 45 146 2.979 1 3 0 0 1 0 0 0 2.979 0 46 166 3.877 1 4 0 0 0 1 0 0 0 3.877 47 129 2.79 1 1 1 0 0 0 2.79 0 0 0 48 138 4.032 1 2 0 1 0 0 0 4.032 0 0 49 148 3.768 0 2 0 1 0 0 0 3.768 0 0 50 132 3.017 1 2 0 1 0 0 0 3.017 0 0 51 150 3.628 1 3 0 0 1 0 0 0 3.628 0 52 129 2.79 1 1 1 0 0 0 2.79 0 0 0 53 166 3.877 1 4 0 0 0 1 0 0 0 3.877 54 170 4.132 1 4 0 0 0 1 0 0 0 4.132 55 134 2.998 1 2 0 1 0 0 0 2.998 0 0 56 138 3.673 0 3 0 0 1 0 0 0 3.673 0 57 134 2.998 1 2 0 1 0 0 0 2.998 0 0 58 164 4.01 0 4 0 0 0 1 0 0 0 4.01 59 126 2.956 1 1 1 0 0 0 2.956 0 0 0 60 170 4.132 1 4 0 0 0 1 0 0 0 4.132 61 149 3.301 1 3 0 0 1 0 0 0 3.301 0 62 160 3.612 1 2 0 1 0 0 0 3.612 0 0 63 142 3.024 1 1 1 0 0 0 3.024 0 0 0 64 132 3.21 0 2 0 1 0 0 0 3.21 0 0Explanation / Answer
solution:
(1A) Hypothesis for the given problem is as follows
HT : M1s=M1n ; M2s=M2n ; M3s=M3n ; M4s=M4n .
here M stands for population mean of SBP ; s for smokers ; n for non smokers; and 1,2,3,4 are represents age groups in the given problem.