Wednesday, February 21, 2007

Chapter 11 Inference for Distributions

To understand this chapter you have to understand the processes of Chapter 10.


The t-distribution is a lot like the normal (z) distribution. It is much more forgiving (look for the references in the book to robustness) than the normal and we use it mostly when we have only a sample to work from--no population standard deviation.

The formulas involving t start out a lot like the z formulas.

t-statistic = (x-bar - mean)/(sample std dev/sqrt n)

and t-interval boundaries are x-bar +/- t* (sample std dev/sqrt n)

We use n-1 degrees of freedom because we "lost " one when we used x-bar to create the estimator s.

The sample std dev / sqrt n is called the standard error of the mean.


The value we use for t*, in fact the line of the table we use when considering probabilities, is based on the number of degrees of freedom (df). You can't use a line with a df = some number if you don't have at least that number of degrees of freedom. It's kind of like buying stuff. If you don't have the money, you can't buy the product. Do you realize what this means??? If you have 990 degrees of freedom and the closest choices in the text are 100 and 1000, you are supposed to select the conservative number, the one you can afford, 100 df. Now, if you can get a closer number from your calculator, use it.

How can you get the value from your calculator? (1) Use the Inv T program or function. Ti-84s with system 2.41 have it. If you have an '84, upgrade your system. If you have something else, get the program.
(2) Use the trick we demonstrated in class: Use T-INT with x-bar = 0, sx = sqrt of n, and n = n. The upper bound of the interval you generate is the estimate for t*.


Paired t-test

This is a routine t-test that is done on matched-pairs data. When you can load the first data set into L1 and the second into L2 and the following two conditions hold, you are looking at a matched-pairs design. (1) Each row of the data has to be naturally linked, as in data coming from the same person--and a different person from the rest of the rows. The two lists are DEFINITELY NOT independent of each other. (2) The variable of interest is the difference between the two values, like L1 - L2. The null hypothesis is usually mu(of the differences) = 0.

To perform the test, just do the regular t-procedures on the column of differences. DF still equals n-1.

If the two sets of data are two independent samples, that's something different. . ..

Two-sample tests

Note: The t-statistic for the difference betwen two means IS NOT t-distributed, but it is pretty close under most conditions.

We use two-sample procedures when we are looking at two separate, independent samples and trying to make an inference about the difference between the two population means.

While most of the procedure is intuitive, the standard error and the number of degrees of freedom require a little explanation.

Std Error of the difference of the means:
Do you remenber how we can't add std deviations? And how the variance of the difference of two variables is the sum of the variances? Put it together for this problem.

Find each sample variance--(s/sqrt(n))^2. Add the two sample variances together. Take the square root. In these formulas, s1 is the sample std dev for the first sample, n1 is the size of the firs sample, etc.

Then the std error of the difference = sqrt( (s1^2/n1) + (s2^2/n2) ).

Degrees of freedom:
For the number of degrees of freedom, either use the number that the calculator or the computer calculates for you or use the more conservative minimum of n1-1 or n2-1.

Hypothesis:
Ho: mu1 = mu 2 which is equivalent to Ho: mu1 - mu2 = 0

Other than these little changes, the procedures are similar to those you've already practiced.



Pooled vs unpooled

This refers to the situations when you believe that the variances of the two populations should really be equal. Using a concept similar to our Law of Large Numbers, combining the standard deviations from the samples in a clever way creates an even stronger estimate for the ONE estimated standard deviation. This is pooling of variances.

Just because the means are the same we cannot assume that the variances are equal also.

We almost never pool variances of X-bar. You can generally leave your calculator set on UNPOOLED and forget about memorizing the formula. You can only pool variances if you are really sure that the variances are equal.

Tuesday, February 06, 2007

Chapter 10 Beginning of Inference

This chapter introducecs important methods under the highly unrealistic conditions where we know the population standard deviation but not the population mean.

Point estimates for the average value of X found through samples are generally good estimates, but they are wrong. You can generate a better estimate by creating a confidence interval.

The confidence interval =
x-bar +/- Z* times sigma of x / (Sqrt n).

We get Z* from the t-table for a specific confidence level, for instance when we want a 95% we use 1.96.

In creating a complete solution we first write down all of the given information. Define your variable. Then we determine whether the central limit theorem has "kicked in" or if the underlying data were already normally distributed. Be sure to address whether the data were from a SRS. Graph them if you have them to make sure there are no gaps or outliers. Is the sample size less than 1/10 of the population size???

Identify what you are trying to produce-- a 95% Z interval for mu and give the formula. Show how the numbers are plugged in and calculate the interval.

Write the interpretation of your interval.

We are 95% confident that the true population mean value of [insert the contextual information here] falls between [lower bound] and [upper bound].

Refer to your notes for all of the baaaaaaaaaaaaad interpretations of a confidence interval and NEVER use them. :)

If a value of mu had been proposed before we collected our sample, we could see if the value falls within our interval. If the proposed value does fall in the interval, then it is a reasonable value, although not necessarily correct. If it does not fall in the interval, then it is not a reasonable value according to our sample values.

Hypothesis tests

For hypothesis tests, you develop a null and alternate hypothesis BEFORE you collect data. Both hypotheses use the parameter (NEVER THE STATISTIC) and they are considered logical opposites. The null hypotheses ALWAYS has an "equals" aspect to it: the alternate hypothesis is always <, >, or not equal to.

For instance: H0: mu = 15
Ha: mu > 15.

Although these are not actually opposites, finding evidence that mu is less than 15 provides no support of the alternative hypothesis. You can think of the null hypothesis in this case as mu<=15, which still has an "equals" in it. This is the way I learned hypothesis-writing back in the day and it is still acceptable, but not as common.

Alpha, Beta, Type I error, Type II error, and Power

Alpha is the likelihood of a Type I error--accidentally rejecting the null hypothesis when it was actually correct. (Like convicting the wrong guy.)

Beta is the likelihood of a Type II error--failing to reject the null when it was wrong. (Kind of an error of omission, or not enough evidence to convict.)

Power is the likelihood that the test would have been sensitive enough to pick up the difference between the hypothesized mu and the actual mu (given some other new value for mu). This is the complement of Beta. Yes, 1 - Beta = Power. 1 - power = beta. Power + beta = 1.

Notice that alpha and beta are NEVER added together. They don't live under the same conditions--one assumes that the null was true and the other that the null was false. DO not fall into the trap of EVER adding alpha and beta together (unless you are TOLD to do it and then only if they offer you a lot of money or a passing grade on a test).

Calculating beta is easier than people think on the calculator.
(1) Figure out what the critical values are for rejection of Ho in terms of x-bar.

(2) Find the area under the curve centered at the NEW mu that falls between these critical values. You can use normalcdf(left_critical_value, right_critical_value, new mean, standard dev or error of x-bar).

Saturday, January 20, 2007

Chapter 9 - Sampling Distributions

How does the sample size affect our estimate and our decisions?

Parameters are the (usually unknown) measures of a population. Often they are represented by Greek letters like mu and sigma.

Statistics are the calculated measures generated from the samples. Statistics are estimators for parameters.

When the average of a statistic is the parameter itself, it is called an unbiased estimator. X-bar is an unbiased estimator for mu, the population mean.

Sampling distributions are the distributions of all of the averages of all of the samples of size n taken from a population.

When the sample size n increases, the variability of the means of the samples decreases--the graph of the sampling distribution is taller and narrower. When the sample size n decreases, the variability of the means of the samples increases.

This holds for sample proportions. The mean of the sample proportions (p-hats) is the true proportion for the population, p. Under special conditions we can use a formula for the standard deviation of the p-hats: SQRT(p*(1-p)/n).

The condition that allows this is that the sample is less than 1/10th of the population (and, of course, we're talking about simple random samples!!)

Also, the really BIG twist is that we can also use an approximation to the normal distribution when the expected numbers of successes and and failures are both 10 or more.

So, about that CLT thing. . . What was the REALLY BIG idea with the Central Limit Theorem???

How do you express the distributions for a binomial X, a geometric X, a uniform X, a normal X, the sampling distribution (X-bar), and the sample proportions (p-hat)?

When can you assume that the sampling distribution is approximately normally distributed?

What do you have to write to support your calculations of mean and standard deviation? your calculations of probabilities?

Monday, January 08, 2007

Chapter 8 - Binomial and Geometric distributions

Part 1 - Binomials

Binomial distributions have the following defining characterisitics:

(1)Only two mutually-exclusive and complementary events are possible on each trial--success or failure.

(2)The number of trials is fixed (n).

(3)The probability of a success on any trial is fixed at p. This DOES NOT mean that the probability of a success is always 50%.

(4)The trials are independent--knowing one outcome does not help you predict the next.

Always define what X represents, for instance, X = number of daughters (successes).

Shorthand identification for a binomial distribution: Binom(n, p).


The calculator will provide probabilities given n and p: binompdf(n,p[,x]) and binomcdf(n,p[,x]). Use pdf when you want probabilities for individual values of X and cdf when you want cumulative values, like the probability that the number of successes is less than or equal to 5. Insert the X value when you want just one value for a specific value of X. You may omit it when you want all the probabilities. Caution! For binomials, the least value X can take is ZERO, not one, so make sure that you associate the right X values with te correct probabilities.


The formula for P(X=k) = nCk p^k * (1-p)^(n-k).

nCk is "n choose k" or n!/(k!*(n-k)!).

If you calculate these probabilities for each possible value of x from 0 to n and add them up you will get a sum of 1.

The expected value or mean of the number of successes in a binomial setting is "mu sub x" = n*p.

The variance of the number of successes in the binomial setting is sigma squared sub x = n * p * (1-p).

The square root is (of course!) the square root of the variance.


What were those directions for loading binomial values into the lists and graphing as histograms? Use seq(X,X,0,n) --> L1 to populate the Xs and binompdf(n,p) --> L2 to insert the corresponding probabilities. To graph, select the histogram tool, use L1 as the xlist and L2 as the freq. You can use zoom 9 to generate a first stab at the graph. Then fix the graph using the window controls.


Part 2--Geometric Distribution

This was different from the binomial in that we are counting the number of trials UNTIL we achieve success, then we stop. This means that X is the number of trials it took and there is no "n" involved. Theoretically, it could take us infinitely many tries before we had a successful result.

Defining characteristics: fixed p, s/f, independent trials, count until success (not a fixed n).

The expected value of x, the number of trials required, is 1/p, where p is the probability of a success in one try. The variance is (1-p)/p^2.

The probability distribution for x = 1, 2, 3, 4, etc. is p, (1-p)p, (1-p)^2*p, (1-p)^3*p, etc.

What is the probability that it takes more than k attempts before you get a success?

Tuesday, January 02, 2007

State of Fear

The rhetorical questions:

What does State of Fear refer to?

What is true? How do you know? Who do you trust? What role does the statistician play in your understanding of news? What role do the media play?


The question to answer:

How can someone lie with statistics?

Friday, December 15, 2006

Reviewing for the 1st Semester Final

Heard in passing today:

Hang up. Log off. Study.

OK, if you log off you can't blog with the APSTAT crowd.

*** What are the most important concepts from each chapter?
*** What are the parts that you still don't understand?

HW: Write down the three most important from each chapter, 1-7. Due Monday.

*** CiCi's on Sunday.
*** Review sessions Monday 8-9PM for 5th and 6th periods, Tuesday 8-9 PM for 1st and 7th periods.

*** I have a meeting Monday morning. I will get to the MU as soon as possible.

*** Yes, we are having classes in 1st and 7th periods on Tuesday!

Post away, my statty friends.

Thursday, December 07, 2006

Chapter 7 Random Variables

This chapter prepares us to work with distributions of random variables and to find their measures of center and spread.

E[X] = the sum of (x * P(x) for all values of x).

The rules for means are straight-forward. The expected value of a random variable, E[X], is the mean, commonly called mu. The mean of the sum of random variables is the sum of the means. The mean of the difference of random variables is the difference of the means. The E[aX] = a*E[X]. The expected value of a constant is just that constant.

Really complex example: E[aX + bY + c] = a*E[X] + b*E[Y] + c.


When you work with measures of spread you have to be more careful! You cannot add standard deviations. You must work with their squares--the variances.


Var[X] = the sum of ((x-mu)^2 * P(x) for each value of x)


= E[X^2] - (E[X])^2


The Var[aX + b] = a^2 * Var[X]. The constant, b, does not vary, so it contributes NOTHING to the variance.


Now, IF X AND Y ARE INDEPENDENT (THAT"S A BIG IF!!!!!!), then Var(X + Y) = Var(X) + Var(Y). If they are NOT independent, then there is some covariance factor which could be increasing or decreasing the variance. The covariance concept is beyond the scope of this course.

That covariance thing is why we can't calculate the variance of the sum of the math and verbal portions of the SAT directly. We know that these scores are not independent.

Examples from class:

X={1, 11}, Y={-4, 20}, X+Y={-3, 7, 21, 31}

Find the variance of each set and look for a pattern.

Here's another:
X={1, 15}, Y={-4, 44}, X+Y={-3, 11, 45, 59}

Can you create two sets which, when added together, have a variance of 100?