STA220 Assignment 2 Q1,2

.pdf

School

University of Toronto *

*We aren’t endorsed by this school

Course

220

Subject

Statistics

Date

Jan 9, 2024

Type

pdf

Pages

3

Uploaded by MajorValor12376

Report
Question 1 (6 marks) We are interested in the proportion of songs that are in a major key. Answer the following questions using the Spotify dataset. For calculations that you complete in R, show your code and output. a) Test whether 50% of songs are in a major key using α = 0.1. State the hypotheses, calculate the Z-statistic and p-value using R, and state the relevant conclusion (4 marks) b) Compute a 99% confidence interval for the proportion of songs that are in a major key. You may use p ≈ 0.5. Interpret the interval. (2 marks) (a) Let p be the proportion of songs in a major key. The null hypothesis (H 0 ) is that p = 0.5, and the alternative hypothesis (H 1 ) is that p ≠ 0.5. Since we are not trying to test whether p is stricly less or more than 0.5, we use a two-tailed test. Since α = 0.1, our confidence level is 90% (conf.level=0.9). Running the above code, we get 4.76 as the Z-statistic and 1.92e-06 as the p-value. Conclusion: Since the p-value is less than 0.1, we reject the null hypothesis; the proportion of songs in a major key is significantly different from 50%.
(b) We get the following confidence interval: Interpretation: We are 99% confident that the true proportion of songs in a major key is between 0.53 and 0.61 (rounded to 2 decimal places). Question 2 (6 marks) We are interested in the average beats per minute of a song. Answer the following questions using the Spotify dataset. For calculations that you complete in R, show your code and output. a) Test whether the average beats per minute of a song is equal to 124 bpm using α = 0.05. State the hypotheses, calculate the test statistic and p-value using R, and state the relevant conclusion. (4 marks) b) Compute a 90% confidence interval for the average beats per minute of a song. Interpret the interval. (2 marks) (a) Our null hypothesis (H 0 ) is that mu = 124, and our alternative hypothesis (H 1 ) is that mu ≠ 124.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help