Question

In: Statistics and Probability

Assume that I asked heights of 40 female students. It turns out that average height and...

Assume that I asked heights of 40 female students. It turns out that average height and standard deviation of ladies in our class is 164 cm and 9 cm, respectively. For all computations, assume that the heights follow a normal distribution. (STATISTICS)

a) Write a function in R that calculates the confidence interval for given ?, X̄, s and n.

b) Write a function in R that calculates the prediction interval for given ?, X̄, s and n.

c) Write a function in R that conducts a hypothesis test. The function’s output will be “reject” or “don’t reject” using the input values of ?, X̄, s and n.

Solutions

Expert Solution

Here, n = 40

= 164

s = 9

a) To calculate confidence interval, we can use the below function

Below solution if for 5% significance. Can be charged as per a value

> a <- 0.05 
> x <- 164
> s <- 9
> n <- 40
> error <- qnorm(1-a/2)*s/sqrt(n)
> left <- a-error
> right <- a+error
> left
[1] 161.2109
> right
[1] 166.7891

b) Prediction interval is given by The function in R will be written as:-

> a <- 0.05
> x <- 164

> s <- 9

> error <- qnorm(1-a/2)*s

> left <- a-error

> right <- a+error

> left [1]

146.36

> right [1]

181.64

c) Function for two-tailed hypothesis test

The null hypothesis is that μ = 170. We begin with computing the test statistic.

> x = 164 # sample mean
> mu = 170 # hypothesized value
> s = 9 # sample standard deviation
> n = 40 # sample size
> z = (xbar−mu)/(s/sqrt(n))
> z                      # test statistic
[1] -4.21637

We then compute the critical values at .05 significance level.

> a = .05
> z.half.alpha = qnorm(1−a/2)
> c(−z.half.alpha, z.half.alpha)
[1] −1.9600  1.9600

> If −z.half.alpha <= z <=  z.half.alpha, "Do No Reject", "Reject"

[1] Reject


Related Solutions

Assume that I asked heights of 40 female students. It turns out that average height and...
Assume that I asked heights of 40 female students. It turns out that average height and standard deviation of ladies in our class is 164 cm and 9 cm, respectively. For all computations, assume that the heights follow a normal distribution. For hypothesis test questions please use 5 step procedure. a. (CI) Find a 95% confidence interval for the height of the female students. b. (CI) Without making any computation, can you test whether ?=163 or not at ?=0.05? Why?...
Last summer I collected data from my students and it turned out that their average height...
Last summer I collected data from my students and it turned out that their average height was 67” with standard deviation 4.0”. There were 58 students in class that day. I want to know if my students are, on average,taller than I am? I am 64” tall. 1. we are testing 2. H0: 3. Ha: 4. We will do a z-procedure because the sample size is large. 5. If the population mean __________ is indeed __________, then due to sampling...
1. Assume that female students’ heights are normally distributed with a mean given by µ =...
1. Assume that female students’ heights are normally distributed with a mean given by µ = 64.2 in. and a standard deviation given by σ =2.6 in. a) If one female student is randomly selected, find the probability that her height is between 64.2 in. and 66.2 in. b) If 25 female students are randomly selected, find the probability that they have a mean height between 64.2 in. and 66.2 in.
Assume that female students’ heights are normally distributed with a mean given by µ = 64.2...
Assume that female students’ heights are normally distributed with a mean given by µ = 64.2 in. and a standard deviation given by σ =2.6 in. a) If one female student is randomly selected, find the probability that her height is between 64.2 inches and 66.2 inches b) If 25 female students are randomly selected, find the probability that they have a mean height between 64.2 inches and 66.2 inches
Suppose we measure the heights of 40 randomly chosen statistics students. We find a mean height...
Suppose we measure the heights of 40 randomly chosen statistics students. We find a mean height of 175cm. Since we have a sufficiently large sample, let’s just assume that the sample standard deviation is the same as the population standard deviation = 20cm. Construct a 95% confidence interval for the population mean height of statistics students AND write a sentence interpreting your results. Construct a 99% confidence interval for the population mean height of statistics students AND write a sentence...
40 random college students were asked about their gender, age, height, weight, and ethnicity. The results...
40 random college students were asked about their gender, age, height, weight, and ethnicity. The results were listed in the table below. GENDER AGE HEIGHT (cm) WEIGHT (lb) ETHNICITY 1 M 18 165 175 Japanese 2 M 24 188 180 Chinese 3 M 19 190 200 Caucasian 4 M 19 192 200 Caucasian 5 M 18 175 160 Mixed 6 F 18 152 112 Japanese 7 F 18 152 120 Filipino 8 F 20 180 180 Mixed 9 F 21...
The heights of female students in a university are approx normally distributed with a mean of...
The heights of female students in a university are approx normally distributed with a mean of 162 cm and a standard dev of 8 cm. Explain your answers. a) Approx 68% of all female students in a university will have heights between ____ cm and ____ cm. b) Heights greater than ____ cm would be considered peculiar.
The average height of a woman is 5'4. I asked 20 women 18 and older what...
The average height of a woman is 5'4. I asked 20 women 18 and older what their height was. One woman is 4'9, one is 5'1, one is 5'2, two are 5'3, four are 5'4, four are 5'5, four are 5'6, one is 5'8 and two are 5'9 For this sample, complete the following: a. Calculate the mean, standard deviation, and variance. b. Calculate the 95% Confidence Interval for the population mean. c. Use your sample to test the hypothesis...
The heights of 500 female students, half of whom are college students while the other half are second-grade students.
The heights of 500 female students, half of whom are college students while the other half are second-grade students.Describing Distributions. For each distribution described in Exercises, answer the following questions:a. How many modes would you expect for the distribution?b. Would you expect the distribution to be symmetric, left skewed, or right-skewed?
a) Assume that the height (in inches) of an American female is normal with expected value...
a) Assume that the height (in inches) of an American female is normal with expected value 64 inches and standard deviation 2.5. Also, assume that the height of an American male is normal with expected value 69 inches and standard deviation of 3.0 inches. A man and a woman are chosen at random. The woman’s height is measured, and she is found to be exactly 68.2 inches tall. How much taller do we expect the man to be (as compared...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT