STAT-1000---Worksheet-9---Shell

.pdf

School

University of Manitoba *

*We aren’t endorsed by this school

Course

1000

Subject

Statistics

Date

Feb 20, 2024

Type

pdf

Pages

2

Uploaded by huongnguyenthu307

Report
STAT 1000 - Worksheet 9 Thu Huong (Rosie) Nguyen 2022-11-28 Instructions To complete this assignment, add code as needed into the R code chunks given below. Do not delete the question text. This is a group worksheet, and you may form a group with your classmates of no more than three (3) students. Be sure to change the author of this file to reflect the names and student numbers of your group members. To properly see the questions, knit this .Rmd file to .pdf and view the output. You will have a link in your email that takes you to the Crowdmark submission page. Once you have completed the worksheet, knit it to .pdf and upload your output to Crowdmark. Make sure you properly identify your groupmates through Crowdmark (it will prompt you). Please note that you may only share your code with your groupmates. Sharing your code with any of your other classmates will be considered an act of academic dishonesty. Questions 1. Import the MLB50 dataset here, and load in the BSDA package. MLB50 <- read.csv( "~/Downloads/MLB50.csv" ) library(BSDA) ## Loading required package: lattice ## ## Attaching package: ’BSDA’ ## The following object is masked from ’package:datasets’: ## ## Orange 2. Suppose it is known that the population standard deviation of ages is 4.32 years. Use this information to calculate a 97% confidence interval for the true mean age of the population with the z.test function. z.test(MLB50$Age, alternative = "two.sided" , sigma.x = 4.32 , conf.level = 0.97 ) ## ## One-sample z-Test ## 1
## data: MLB50$Age ## z = 46.395, p-value < 2.2e-16 ## alternative hypothesis: true mean is not equal to 0 ## 97 percent confidence interval: ## 27.0186 29.6702 ## sample estimates: ## mean of x ## 28.3444 3. Use nsize to determine the minimum sample size required to calculate a 97% confidence interval with a margin of error of no more than 1 year. nsize( 1 , sigma = 4.32 , conf.level = 0.97 ) ## ## The required sample size (n) to estimate the population ## mean with a 0.97 confidence interval so that the margin ## of error is no more than 1 is 88 . 2
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