STAT 231 Winter 2024
Assignment 4
Assignment 4 Learning Outcomes
Here are the intended learning outcomes for this assignment component. Try to identify the learning outcomes which are achieved by each of the given problems.
Enjoy
· Perform a test of hypothesis for Binomial(n,θ), Poisson(θ), and Exponential(θ) models using a test statistic based on the asymptotic Gaussian pivotal quantity and a likelihood ratio test.
· Perform a test of hypothesis for the parameter μ and the parameter σ in a Gaussian model.
· Observe the connection between confidence intervals, likelihood intervals and hypothesis tests.
· Observe how p-values vary as the hypothesized value and sample size vary.
In Problems 1-4 you will continue to analyse variates in your data set. Make sure that you use the same data set that you generated, saved, and uploaded to the LEARN Dropbox as part of the Prerequisite Assignment.
Your commented R code should only be included in the R file that you upload to the LEARN Dropbox. Do not include your R code in your answers submitted to Crowdmark. All written answers must be in full sentences. Please do not include any instructions in your assignment submission to Crowdmark or the LEARN Dropbox.
The R code given in Problems 1-4 is also available in a text file called Assignment 4 R code posted in the Assignment 4 folder on LEARN.
Note: When conducting a test of hypothesis you should use a two-sided test unless otherwise stated. Be sure to show how your p-value was determined. When stating a conclusion about a null hypothesis please use the guidelines in Table 5.1 of the Course Notes. In this course we do not accept/reject hypotheses. Such conclusions will be marked wrong.
Problem 1: Tests of hypothesis for Binomial model
The purpose of this problem is to test the hypothesis H0 : S = S0 for Binomial(n,S) data. See Sections 5.1 to 5.3 and Table 5.2 of the Course Notes.
In this problem you will examine the data for the variate Wearing.a.watch (Are you wearing a watch? Yes or no?) for students who are aged less than 13.
The following R code provides you with the information you need for doing this question.
# data are assumed to be in the matrix called dataset
# Age variate in column 5, Watch variate in column 20
watch<-dataset[,c(5,20)]
watch<-watch[complete.cases(watch),]
# Watch observations for students aged less than 13
watch.lt13<-watch$Wearing.a.watch[watch$Age<13]
table(watch.lt13)
# the possible values for the derived variate watch.lt13 are yes, no and blank (missing)
(a) Include the following completed sentences in your assignment:
(i) My student ID number is __________.
my wechat:_0206girl
Don't hesitate to contact me