Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

STATS 1000 / STATS 1004 / STATS 1504

Statistical Practice 1

Assignment 4

2022

1.  One-sample t-test in R

This question must be typed in Word

Fifty large banks and savings institutions were randomly selected from all the large banks and savings institutions in America and their total amount of deposits (in $ billions) were recorded.  This data is given in bank.xlsx” on MyUni.

This data has two variables:

. bank: name of the bank

. deposits: total amount of deposits in $ billions

A financial analyst claims that the average amount of deposits in large Amer- ican banks and savings institutions is $ 120 billion. In this question, we will test if the data from bank.xlsx” is consistent with this statement.

(a) First examine the distribution of the total amount of deposits by doing

the following:

i. Produce a histogram of the variable deposits in R and include in your assignment.

[1 mark]

ii. Describe the distribution total amount of deposits.      [4 marks] (b) Perform a one-sample t-test of the null and alternative hypotheses

H0  : µ = 120,

Ha  : µ  120,

where µ is the true population mean deposits in large American banks and savings institutions in $ billions.

To do this, complete the following steps:

i. Perform a one-sample t-test in R and include the output in your assignment.

[1 mark]

ii.  State the value of the test statistic.

[1 mark]

iii.  State the P-value.

[1 mark]

iv.  State the distribution of the test statistic if the null hypothesis is true.

[2 marks]

v.  State whether you reject or retain the null hypothesis at the 5% significance level? Justify your decision.

[2 marks]

(c) Using your R output, calculate a 95% confidence interval for the mean deposits in large American banks and savings institutions in $ billions. Interpret this interval in context.

[3 marks]

(d)  Check the assumption of normality of the sample mean with the follow- ing steps:

i. Produce a normal QQ-plot of the total amount of deposits and include in your assignment.

[1 mark]

ii. Using the normal QQ-plot, decide if the assumption of normality is reasonable for total amount of deposits.   If not,  describe the theorem that could be used to justify the use of the t-test?

[2 marks]

(e) Presentation marks (1 for word, 1 for informative table captions, 1 for

informative gure captions.)

[3 marks]   [Total: 21]

2. Two-sample T-test in R

For full marks, this question must be typed in  Word, all required R output should be included and captioned.

In practical 7, we looked at whether passing the Bechdel test affects a movie’s profits. In this assignment, you have to check whether the genre (Drama or Horror), affects a movie’s IMDb rating?

IMDb 1  is an online database of information related to movies, television programs, home videos, video games, and online streaming content.  IMDb registered users can cast a vote (from 1 to 10) on every released title in the database. Individual votes are then aggregated and summarized as a single IMDb rating, visible on the title’s main page.

The dataset movies .xlsx has movies that were released from 1986 onwards. The column genre indicates whether the movie is a Drama movie or a Horror movie, and the column imdb is the IMDb rating recieved.

(a) Import the dataset into R and produce a panel histogram of imdb for

each genre (include your captioned plot in your final submission). What is the shape of the distribution of IDMb ratings for each type of movie?

[3 marks] (b) Produce a side by side boxplot for IMDb ratings for each genre

[1 mark]

(c) Perform a two-sample t-test in R (include your output in your submis- sion).

[1 mark]

i. Write down appropriate null and alternative hypotheses for the two-sample t-test. Remember to define any parameters used.

[2 marks]

ii. What is the observed value of the test-statistic?

[1 mark]

iii. What is the distribution of the test statistic if the null hypothesis is true? Note:use the R output for the degrees of freedom.

[2 marks]

iv. What is the P-value?

[1 mark]

v. Do you reject or retain the null hypothesis at the 5% significance level? Why?

[2 marks]

vi.  State the conclusion of the two-sample T-test according to the con- text.

[1 mark]

(d) What is the 95% confidence interval for the difference in the population mean IMDb ratings for Drama movies to Horror movies.

[2 marks]

(e) Produce in R, and include in your submission, appropriate plots to test

the assumption that the IMDb ratings in each genre are from a normal distribution. Is this assumption reasonable for each genre?

[4 marks]

(f) According to the above normality results is the two-sample t-test still

reasonable in this case? Why?

[2 marks]

(g) What are other two assumptions for two-sample t-test?

[2 marks]

(h) Presentation marks (1 for Word, 1 for informative gure captions, 1 for

informative table captions).

[3 marks]

[Total: 27] [[Assignment total: 48]]