Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
STAT 3503 Regression Analysis
Assignment #2 Consider i.i.d observations and the usual regression model with
All plots should have titles Level 1 questions, easy or direct from the book: 1. (2points)
Set up the matrix and vector assuming that n = 4 2. (4points) Show that an equivalent
way to write the above regression model is Level 2 questions, challenging if its been a
while you have done this. 3. (20points) A. (1point) Obtain the Trade Data of monthly export of
grains from Statistics Canada’s Open Government. Clean and organize your data as you observe on the
website provided. Make a scatter plot of the year of export (year) against the total exports in tonnes (total)
B. (3points) Remake the plot in part A but first subset the data so that you are only considering
two commodities: “Barley”, “Oats”. Make sure you color the points with the type of commodity.
Include in your plot one single regression line for this subset of the dataset, add a second regression
line for this subset of data, but make sure you force the line to have a zero intercept. C. (6points, 3points for each model )
Write down the mathematical formulae for the two regression models included in your plot in B and
provide clearly how you will fit these two models in R. Make a 95% confidence interval for the slope and intercept for the first model Make a 95% confidence interval for the slope for the second model Finally put your answer into a complete sentence for each model. D. (5points each: 1point hypotheses, 3points appropriate number to do the problem mathematically by hand, 1point conclusion) Test the hypothesis that total export of Barley and Oats are increasing by 5 tonnes. Test the hypothesis that when there is no fiscal year, there are no exports of Barley and Oats. Y1,…,Yn Yi = β0 + Xi1β1 + Xi2β2 + εi εi ∼ N(0,σ2) X β ̂Yi = Y¯ + β1(Xi1 − X¯1) + β2(Xi2 − X¯2) STAT 3503 Regression Analysis 4. (16 points) Modify your data from part B by adding a dummy variable with Barley ==1 and Oats==0. A. (2points) Write down the appropriate regression model for this new dataset. State clearly the intercepts for commodities Barley and Oats. B. (2points) Make a 95% confidence interval for the intercept of Barley C. (2points) Make a 95% confidence interval for the intercept of Oats D. (3points: 1point hypotheses, 1 point appropriate numbers to do the problem mathematical by hand, 1 point conclusion) Test the hypothesis that total export of Barley is greater than the total export for Oats. E.(7points) Consider the data for only Barley using your data in part D. Make a 90% Confidence Interval for the mean observation for year 2019.