Module #6 Assignment

 10/2/2023

A.
Consider a population consisting of the following values, which represents the number of ice cream purchases during the academic year for each of the five housemates.
8, 14, 16, 10, 11

a. Compute the mean of this population.

population <- c(8, 14, 16, 10, 11)
mean(population)
11.8 

b. Select a random sample of size 2 out of the five members. 

> sample_size <- 2
> sample <- sample(population, sample_size)
> cat("Random sample:", sample, "\n")
Random sample: 16 14

c. Compute the mean and standard deviation of your sample.

mean(sample)
15 
sd(sample)
1.414214 

d. Compare the Mean and Standard deviation of your sample to the entire population of this set (8,14, 16, 10, 11).

With only 2 of the five members, the mean was higher and standard deviation was lower than the original sample.

B. 

Suppose that the sample size n = 100 and the population proportion p = 0.95.

  1. Does the sample proportion p have approximately a normal distribution? Explain.
After calculating np and n(p-1), both are greater than or equal to 5. Therefore, the distribution would be assumed to be normal.
  1. What is the smallest value of n for which the sampling distribution of p is approximately normal?   
Generally, the value of p n should be greater than or equal to 5, however this can vary with extreme sample sizes.

A. Population mean= (8­­+14+16+10+11)/ 5 
B. Sample of size n= 100
C. 
Mean of sample distribution: .95
D.  Observation (X) | Sample Mean (x̄ = 0.95) | (X - x̄)^2          |
  |-----------------|-----------------------|---------------------|
  | 1               | 0.95                  | (1 - 0.95)^2 = 0.0025 |
  | 0               | 0.95                  | (0 - 0.95)^2 = 0.9025 |
  | ...             | ...                   | ...                 |
np = 100 * 0.95 = 95 nq = 100 * 0.05 = 5

C.
 > rbinom(15, size = 1, prob = 0.5)
 [1] 1 0 1 1 1 0 1 0 1 1 0 1 0 0 0

Comments

Popular posts from this blog

Module #11 Assignment

Module #12 Assignment

Module #9 Assignment