Confidence intervals

We want to investigate what is meant by a statement such as

The poll of 1000 people reported 44% in favor. The margin of error is 3%.

Actually of course there are 4 things to mention

We know that they are all tied together with the statement

A large sample (1-$\alpha$)100% confidence interval for $\pi$ based on $p$ is given by the limits

$$p \pm z^* \sqrt{\frac{p(1-p)}{n}}$$

We wish to investigate this with MINITAB. To do so, we will do the following. We will fix a value of $\pi$ and $n$, then we will generate 100 random samples of a Binomial and compute $p$ for each. Then we will figure out what percent are within the predicted range and compare this with $(1-\alpha)100$%. Here are the steps for you. Do this first for $n=100,\pi=.5$ and do for $\alpha=0.05, 0.01$, then with $n=1000,\pi=.4$ and $\alpha=0.05, 0.01$:

  1. Generate 100 binomial samples with the given value of $n$ and $\pi$.

  2. Create the value of $p$ by dividing.

  3. Figure out the appropriate confidence interval. (We know that $\pi$ should be within

    $$(p - z^*\sqrt{\frac{p(1-p)}{n}},p - z^*\sqrt{\frac{p(1-p)}{n}})$$

    a certain percentage of the time. So reversing, $p$ should be within

    $$(\pi - z^*\sqrt{\frac{p(1-p)}{n}},\pi - z^*\sqrt{\frac{p(1-p)}{n}})$$

    the same percentage (why?).) Now, how can we use MINITAB to count the number of times this actually happens?

  4. Compare and then repeat with new values. Is the theory born out by your experiments?

The T-distribution

We want to investigate the $t$-distribution. We can do this a few ways. First, MINITAB will gladly generate random samples from the $t$ distribution if we ask it. Second, we can create our own by looking at

$$t = \frac{\bar{X} - \mu}{s/\sqrt{n}}$$

First, create 100 values of the $t$ distribution for various values of degrees of freedom. Try d.f. = 5, 20,50 and 100. Look at boxplots or normal plots to decide if the distribution looks symmetric or not, long-tailed on not and normal or not.

Next, theory states that if the $X_1,X_2,\dots X_n$ are normal, then the statistic above has the $t$-distribution. with $n-1$ degrees of freedom. Investigate with $n=6$ and $mu =0$ and $\sigma=1$.

Finally, let’s investigate how much this changes of the $X_i$ are no longer assumed to be normal. Will the distribution of $t$ change dramatically? Investigate with $n=6$ and $X_i$ a uniform on the interval $[0,1]$ and again with $X_i$ exponential with mean 4.