首页 > > 详细

讲解 S322 Assignment 1 – Fall 2024讲解 留学生R程序

S322 Assignment 1 – Fall 2024

Due: Oct 3, 2024, ONLINE in Crowdmark

Marking: Please note that the TAs may not be marking all questions in this assignment. The exact questions that will be marked will not be determined until after the due date.  BECAUSE of this, all questions will say 10 marks until westart marking.  This is a Crowdmark default.

Group Work: Please note that you are permitted to work in a group of up to 3 students from your section. Papers with more than 3 people will not be marked. To make it clearer who you have worked with, please write their names on your Crowdmark paper and choose them in Crowdmark. You must do this before you upload your answers. If you use additional sources, acknowledge them in the given question. Failure to acknowledge your people/sources may result in an academic penalty.

Generative AI: Generative AI is not permitted in this course. Please see the outline for further information.

Computer Output: Please include R code in your assignment, as well as all relevant output (some examples where examples would be appropriate).

It is expected that you are answering these questions by hand unless otherwise requested in the question.

Question 1. The Liberal government is keeping track of average Canadian Province CO2 emissions (in megatons).  They first investigated this problem in 1990.  They would like to compare the average provincial CO2 emissions between 1990 and 2022. You may only use R for simple calculations.

Province

BC

Alb

Sask

Man

Ont

Que

NS

NB

PEI

NL

1990

51.1

177.2

49

18.2

157

79.1

14.8

16.2

1.6

9.5

2022

64.3

269.9

75.9

21.6

178

84.4

19.6

12.5

1.8

8.6

Perform. a test of hypothesis to determine whether or not average Provincial CO2 emissions are greater in 2022 than in 1990.

Question 2. The Riley Bay Company (RBC) has been around for centuries. As a result they have a lot of data. They have recorded their revenue, cost and profit (in millions of dollars) from the past 5 years in the data set RBC_profits.csv. You may only use R for simple calculations.

Part A. How many years should Charlie sample the profit to be accurate to a width of 5 million, 8 times out of 10. Part B. Charlie is really interested in the proportion of years where the profit is negative.  How many years should Charlie sample, in the worst case scenario, to be accurate to within 0.1, 19 times out of 20?

Question 3. Consider the model yi   = exp(μ) + Ri, Ri~N(0, σ 2), i  = 1, … , n.  Use Least Squares to estimate the parameters.

Question 4. Consider the following models.

xj  = μ + Rj, Rj~N(0, σ 2), j = 1, …, n

yij  = τ i  + s ij, s ij~N(0, σ 2), i=1,2; j=1,….,mi

zij  = wi  + Tij, Tij~N(0, σi2 ), i=1,2; j=1,….,ki

(all random variables are independent of one another)

Determine the expectation and variance of e ach of the following.

3/1 yij  + 2

̂(μ) + y1j y2j

w2w2  + ̂(w)2

̃(w)2̃(τ)1                             [Just the expectation for this object]

Question 5. Let U~U(0, 1) be a random variables.  Determine each of the following:

Part A. Cov(U, 1 − U)

Part B. Cov (3/U, U − 1)

Question 6. The Riley’Rama Car Washis trying to reduce it’swater usage; and still keep the cars clean.  They believe they have two processes which ensure that the cars are equally clean.  Their response is water usage.  To do so they have 13 cars drive through the Riley’Rama under process 1, and 7 cars drive through under process 2.  They compare the average water used (in gallons) in the two processes.

Process 1 = c(75, 72, 71, 74, 67, 68, 78, 68, 66, 70, 74, 71, 76)

Process 2 = c(69, 62, 65, 68, 56,55, 64)

Build a 95% confidence interval to compare the average water usage of the two processes.  Recall that by default, unless stated otherwise, you should assume that the variances are different.  Which process should they use if their only goal is to reduce water consumption? You may only use R for simple calculations.

Question 7. Ravi and Xinyue are two sales employees in a vehicle lot.  They are competing as to who can sell the most

vehicles in the year.  So far they have information on the first 4 days of their competition.  They decide to use the model, yij  = μ + τ i  + Rij, Rij~N(0, σ 2), indep, i = 1,2;j = 1, … ,4; with constraint iτ i   = 0.  The Data and Code are below.      One in this case is for Ravi, and two is for Xinyue.

TRT = as.factor(c(1,1,1,1,2,2,2,2)) Y = c(5,6,3,3,5,1,X,Y)

options(contrasts = c('contr.sum','contr.poly')) summary(lm(Y~TRT))

Call:

lm(formula = Y ~ TRT)

Residuals:

Min     1Q Median     3Q    Max

-2.25  -1.25  -0.25   1.75   1.75

Coefficients:

Estimate Std. Error

(Intercept)   3.7500     0.6374

TRT1 XXX 0.6374

---

Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘ . ’ 0.1 ‘ ’ 1

Determine each of the following:

Part A. How many degrees of freedom should be used for CIs and HTs using this model?

Part B. What is the value of ̂(σ) for this model?

Part C. What is the value of̂(τ)1,̂(τ)2  = −0.5 for this model?

Part D. Give the smallest possible range (using the reference table) for the pvalue of the test Ha:  τ2  ≠ 0.





联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!