# BIA B350F Assignment 1

## R Language Assignment Question

BIA B350F Assignment 1 Weighting: 20%

Instructions: (Marks would be deducted if you fail to follow the instructions listed below.)

- In answering questions of the assignment, show clearly the steps you take in arriving at your solutions. Keep at least four decimal places in the final answer for statistical computations or otherwise specified.
- Except question 5 which require you to utilize R, the rest of the questions must be answered manually.

Question 1 (14 marks)

□1 4□4 □2

LetA□4 6□,B□2 5□,C□1 2 3□andD□3

Perform the following operations.

(a) A’BandAB (b) CD

(c) BA

(d) A-1 B-1

Question 2 (10 marks)

Solve the following system of equations:

2X1 X2 3X3 5 X1 2X2 4X3 7 X1 X2 X3 10

Question 3 (12 marks)

(4 marks) (3 marks) (3 marks) (4 marks)

2

1

Let E 2 6 . Determine the eigenvalues and normalized eigenvectors of E . 3 5

Question 4 (14 marks)

16 1 1 X1 Let Σ 1 4 2 be the covariance matrix of the random vector x X 2 .

1 2 36 X 3

(a) Determine V

1/2 1/2 -1

, V and ρ . (6 marks)

(b) Find the covariance matrix for the linear combination 2X2 X1 X3 . (4 marks) 1

(c) Find the covariance matrix for the following linear combinations of X1, X2 and X3.

Z1 □X1 □X2 □2X3 Z2 □X1 □2X2 □X3

Question 5 (50 marks)

(4 marks)

A researcher wishes to predict the BMI (body mass index, intended to be a rough measure of body fat) based on a dataset of health and eating habits of Americans collected by the US bureau of Labor Statistics. Having studied the variables of the dataset, she has picked the following seven variables and generated the “bmi_data.csv” dataset (uploaded to the OLE) for analysis:

Variable |
Description |

BMI |
Body mass index |

p_eat_time |
Total amount of time spent in primary eating and drinking (in minutes) over the past week |

s_eat_time |
Total amount of time spent in secondary eating and drinking (in minutes) over the past week |

fast_food |
Did the person purchase fast food in the past week |

exercise_freq |
How many times in the past week the person exercised (outside of their job) |

weight |
Weight, in pounds |

height |
Height, in inches |

- Utilize R to determine the multiple linear regression model to predict the BMI of person by considering which independent variable(s) be included in the model among the other given variables using stepwise regression (forward). You are expected to perform relevant model checking including relevant graphs plotting after the desired model is formulated. All R programs must be included in the answer and marks will be deducted if failing to do so.
(Note: BMI is calculated from the respondent’s height and respondent’s weight and therefore should be excluded from the model. You also have to apply listwise deletion to remove observation with missing data before running the analysis.) (35 marks)

- Perform relevant hypothesis testing to assess the validity of the multiple linear regression model obtained as well as the validity of individual regression coefficients. (10 marks)
- Interpret the regression coefficients of the model. (5 marks)