computer oriented and statistical technique practical Q & A
note - use computer, laptop, tab for better viewing quality.
notes by - Hemant Mehra
1). Suppose the manufacturer claims that the mean lifetime of a light bulb is more than 10,000 hours. In a sample of 30 light bulbs, it was found that they only last 9,900 hours on average. Assume the population standard deviation is 120 hours. At .05 significance level, can we reject the claim by the manufacturer?
Solution
The null hypothesis is that μ ≥ 10000. We begin with computing the test statistic.
> xbar = 9900 # sample mean
> mu0 = 10000 # hypothesized value
> sigma = 120 # population standard deviation
> n = 30 # sample size
> z = (xbar−mu0)/(sigma/sqrt(n))
> z # test statistic
[1] −4.5644
We then compute the critical value at .05 significance level.
> alpha = .05
> z.alpha = qnorm(1−alpha)
> −z.alpha # critical value
[1] −1.6449
Answer-
The test statistic -4.5644 is less than the critical value of -1.6449. Hence, at .05 significance level, we reject the claim that mean lifetime of a light bulb is above 10,000 hours.
2). Suppose the food label on a cookie bag states that there is at most 2 grams of saturated fat in a single cookie. In a sample of 35 cookies, it is found that the mean amount of saturated fat per cookie is 2.1 grams. Assume that the population standard deviation is 0.25 grams. At .05 significance level, can we reject the claim on food label?
The null hypothesis is that μ ≤ 2. We begin with computing the test statistic.
> mu0 = 2 # hypothesized value
> sigma = 0.25 # population standard deviation
> n = 35 # sample size
> z = (xbar−mu0)/(sigma/sqrt(n))
> z # test statistic
[1] 2.3664
We then compute the critical value at .05 significance level.
Answer
The test statistic 2.3664 is greater than the critical value of 1.6449. Hence, at .05 significance level, we reject the claim that there is at most 2 grams of saturated fat in a cookie.
3). Suppose the mean weight of King Penguins found in an Antarctic colony last year was 15.4 kg. In a sample of 35 penguins same time this year in the same colony, the mean penguin weight is 14.6 kg. Assume the sample standard deviation is 2.5 kg. At .05 significance level, can we reject the null hypothesis that the mean penguin weight does not differ from last year?
Solution
The null hypothesis is that μ = 15.4. We begin with computing the test statistic.
> mu0 = 15.4 # hypothesized value
> s = 2.5 # sample standard deviation
> n = 35 # sample size
> t = (xbar−mu0)/(s/sqrt(n))
> t # test statistic
[1] −1.8931
We then compute the critical values at .05 significance level.
> t.half.alpha = qt(1−alpha/2, df=n−1)
> c(−t.half.alpha, t.half.alpha)
[1] −2.0322 2.0322
Answer
The test statistic -1.8931 lies between the critical values -2.0322, and 2.0322. Hence, at .05 significance level, we do not reject the null hypothesis that the mean penguin weight does not differ from last year.
4). Suppose a coin toss turns up 12 heads out of 20 trials. At .05 significance level, can one reject the null hypothesis that the coin toss is fair?
Solution
The null hypothesis is that p = 0.5. We begin with computing the test statistic.
> p0 = .5 # hypothesized value
> n = 20 # sample size
> z = (pbar−p0)/sqrt(p0∗(1−p0)/n)
> z # test statistic
[1] 0.89443
We then compute the critical values at .05 significance level.
Answer
The test statistic 0.89443 lies between the critical values -1.9600 and 1.9600. Hence, at .05 significance level, we do not reject the null hypothesis that the coin toss is fair.
6. Using R perform the binomial and normal distribution on the data.
solve for dnorm and pnorm










Comments
Post a Comment