Friday, December 10, 2010

Statistics Tutorial: Hypothesis Tests

Statistics Tutorial: Hypothesis Tests
A statistical hypothesis is an assumption about a population parameter. This assumption may or may not be true.
The best way to determine whether a statistical hypothesis is true would be to examine the entire population. Since that is often impractical, researchers typically examine a random sample from the population. If sample data are not consistent with the statistical hypothesis, the hypothesis is rejected.
There are two types of statistical hypotheses.
  • Null hypothesis. The null hypothesis, denoted by H0, is usually the hypothesis that sample observations result purely from chance.
  • Alternative hypothesis. The alternative hypothesis, denoted by H1 or Ha, is the hypothesis that sample observations are influenced by some non-random cause.
For example, suppose we wanted to determine whether a coin was fair and balanced. A null hypothesis might be that half the flips would result in Heads and half, in Tails. The alternative hypothesis might be that the number of Heads and Tails would be very different. Symbolically, these hypotheses would be expressed as
H0: P = 0.5
Ha: P ≠ 0.5
Suppose we flipped the coin 50 times, resulting in 40 Heads and 10 Tails. Given this result, we would be inclined to reject the null hypothesis. We would conclude, based on the evidence, that the coin was probably not fair and balanced.
Can We Accept the Null Hypothesis?
Some researchers say that a hypothesis test can have one of two outcomes: you accept the null hypothesis or you reject the null hypothesis. Many statisticians, however, take issue with the notion of "accepting the null hypothesis." Instead, they say: you reject the null hypothesis or you fail to reject the null hypothesis.
Why the distinction between "acceptance" and "failure to reject?" Acceptance implies that the null hypothesis is true. Failure to reject implies that the data are not sufficiently persuasive for us to prefer the alternative hypothesis over the null hypothesis.

Hypothesis Tests
Statisticians follow a formal process to determine whether to reject a null hypothesis, based on sample data. This process, called hypothesis testing, consists of four steps.
  • State the hypotheses. This involves stating the null and alternative hypotheses. The hypotheses are stated in such a way that they are mutually exclusive. That is, if one is true, the other must be false.
  • Formulate an analysis plan. The analysis plan describes how to use sample data to evaluate the null hypothesis. The evaluation often focuses around a single test statistic.
  • Analyze sample data. Find the value of the test statistic (mean score, proportion, t-score, z-score, etc.) described in the analysis plan.
  • Interpret results. Apply the decision rule described in the analysis plan. If the value of the test statistic is unlikely, based on the null hypothesis, reject the null hypothesis.
Decision Errors
Two types of errors can result from a hypothesis test.
  • Type I error. A Type I error occurs when the researcher rejects a null hypothesis when it is true. The probability of committing a Type I error is called the significance level. This probability is also called alpha, and is often denoted by α.
  • Type II error. A Type II error occurs when the researcher fails to reject a null hypothesis that is false. The probability of committing a Type II error is called Beta, and is often denoted by β. The probability of not committing a Type II error is called the Power of the test.
Decision Rules
The analysis plan includes decision rules for rejecting the null hypothesis. In practice, statisticians describe these decision rules in two ways - with reference to a P-value or with reference to a region of acceptance.
  • P-value. The strength of evidence in support of a null hypothesis is measured by the P-value. Suppose the test statistic is equal to S. The P-value is the probability of observing a test statistic as extreme as S, assuming the null hypotheis is true. If the P-value is less than the significance level, we reject the null hypothesis.
  • Region of acceptance. The region of acceptance is a range of values. If the test statistic falls within the region of acceptance, the null hypothesis is not rejected. The region of acceptance is defined so that the chance of making a Type I error is equal to the significance level.
The set of values outside the region of acceptance is called the region of rejection. If the test statistic falls within the region of rejection, the null hypothesis is rejected. In such cases, we say that the hypothesis has been rejected at the α level of significance.
These approaches are equivalent. Some statistics texts use the P-value approach; others use the region of acceptance approach. In subsequent lessons, this tutorial will present examples that illustrate each approach.
One-Tailed and Two-Tailed Tests
A test of a statistical hypothesis, where the region of rejection is on only one side of the sampling distribution, is called a one-tailed test. For example, suppose the null hypothesis states that the mean is less than or equal to 10. The alternative hypothesis would be that the mean is greater than 10. The region of rejection would consist of a range of numbers located located on the right side of sampling distribution; that is, a set of numbers greater than 10.

A test of a statistical hypothesis, where the region of rejection is on both sides of the sampling distribution, is called a two-tailed test. For example, suppose the null hypothesis states that the mean is equal to 10. The alternative hypothesis would be that the mean is less than 10 or greater than 10. The region of rejection would consist of a range of numbers located located on both sides of sampling distribution; that is, the region of rejection would consist partly of numbers that were less than 10 and partly of numbers that were greater than 10.

Statistics Tutorial: How to Test Hypotheses

A General Procedure for Conducting Hypothesis Tests
All hypothesis tests are conducted the same way. The researcher states a hypothesis to be tested, formulates an analysis plan, analyzes sample data according to the plan, and accepts or rejects the null hypothesis, based on results of the analysis.
  • State the hypotheses. Every hypothesis test requires the analyst to state a null hypothesis and an alternative hypothesis. The hypotheses are stated in such a way that they are mutually exclusive. That is, if one is true, the other must be false; and vice versa.
  • Formulate an analysis plan. The analysis plan describes how to use sample data to accept or reject the null hypothesis. It should specify the following elements.
    • Significance level. Often, researchers choose significance levels equal to 0.01, 0.05, or 0.10; but any value between 0 and 1 can be used.
    • Test method. Typically, the test method involves a test statistic and a sampling distribution. Computed from sample data, the test statistic might be a mean score, proportion, difference between means, difference between proportions, z-score, t-score, chi-square, etc. Given a test statistic and its sampling distribution, a researcher can assess probabilities associated with the test statistic. If the test statistic probability is less than the significance level, the null hypothesis is rejected.

  • Analyze sample data. Using sample data, perform computations called for in the analysis plan.
    • Test statistic. When the null hypothesis involves a mean or proportion, use either of the following equations to compute the test statistic.
Test statistic = (Statistic - Parameter) / (Standard deviation of statistic)
Test statistic = (Statistic - Parameter) / (Standard error of statistic)
where Parameter is the value appearing in the null hypothesis, and Statistic is the point estimate of Parameter. As part of the analysis, you may need to compute the standard deviation or standard error of the statistic. Previously, we presented common formulas for the standard deviation and standard error.

When the parameter in the null hypothesis involves categorical data, you may use a chi-square statistic as the test statistic. Instructions for computing a chi-square test statistic are presented in the lesson on the chi-square goodness of fit test.
    • P-value. The P-value is the probability of observing a sample statistic as extreme as the test statistic, assuming the null hypotheis is true.
  • Interpret the results. If the sample findings are unlikely, given the null hypothesis, the researcher rejects the null hypothesis. Typically, this involves comparing the P-value to the significance level, and rejecting the null hypothesis when the P-value is less than the significance level.



Statistics Tutorial: F Distribution

Statistics Tutorial: F Distribution
The f statistic, also known as an f value, is a random variable that has an F distribution. (We discuss the F distribution in the next section.)
Here are the steps required to compute an f statistic:
  • Select a random sample of size n1 from a normal population, having a standard deviation equal to σ1.
  • Select an independent random sample of size n2 from a normal population, having a standard deviation equal to σ2.
  • The f statistic is the ratio of s1212 and s2222.
The following equivalent equations are commonly used to compute an f statistic:
f = [ s1212 ] / [ s2222 ]
f = [ s12 * σ22 ] / [ s22 * σ12 ]
f = [ Χ21 / v1 ] / [ Χ22 / v2 ]
f = [ Χ21 * v2 ] / [ Χ22 * v1 ]
where σ1 is the standard deviation of population 1, s1 is the standard deviation of the sample drawn from population 1, σ2 is the standard deviation of population 2, s2 is the standard deviation of the sample drawn from population 2, Χ21 is the chi-square statistic for the sample drawn from population 1, v1 is the degrees of freedom for Χ21, Χ22 is the chi-square statistic for the sample drawn from population 2, and v2 is the degrees of freedom for Χ22 . Note that degrees of freedom v1 = n1 - 1, and degrees of freedom v2 = n2 - 1 .
The F Distribution
The distribution of all possible values of the f statistic is called an F distribution, with v1 = n1 - 1 and v2 = n2 - 1 degrees of freedom.
The curve of the F distribution depends on the degrees of freedom, v1 and v2. When describing an F distribution, the number of degrees of freedom associated with the standard deviation in the numerator of the f statistic is always stated first. Thus, f(5, 9) would refer to an F distribution with v1 = 5 and v2 = 9 degrees of freedom; whereas f(9, 5) would refer to an F distribution with v1 = 9 and v2 = 5 degrees of freedom. Note that the curve represented by f(5, 9) would differ from the curve represented by f(9, 5).
The F distribution has the following properties:
  • The mean of the distribution is equal to v2 / ( v2 - 2 ) for v2 > 2.
  • The variance is equal to [ 2 * v22 * ( v1 + v1 - 2 ) ] / [ v1 * ( v2 - 2 )2 * ( v2 - 4 ) ] for v2 > 4.
Cumulative Probability and the F Distribution
Every f statistic can be associated with a unique cumulative probability. This cumulative probability represents the likelihood that the f statistic is less than or equal to a specified value.
Statisticians use fα to represent the value of an f statistic having a cumulative probability of (1 - α). For example, suppose we were interested in the f statistic having a cumulative probability of 0.95. We would refer to that f statistic as f0.05, since (1 - 0.95) = 0.05.
Of course, to find the value of fα, we would need to know the degrees of freedom, v1 and v2. Notationally, the degrees of freedom appear in parentheses as follows: fα(v1,v2). Thus, f0.05(5, 7) refers to value of the f statistic having a cumulative probability of 0.95, v1 = 5 degrees of freedom, and v2 = 7 degrees of freedom.
The easiest way to find the value of a particular f statistic is to use the F Distribution Calculator, a free tool provided by Stat Trek. For example, the value of f0.05(5, 7) is 3.97. The use of the F Distribution Calculator is illustrated in the examples below.

Point Estimate vs. Interval Estimate

In statistics, estimation refers to the process by which one makes inferences about a population, based on information obtained from a sample.
Point Estimate vs. Interval Estimate
Statisticians use sample statistics to estimate population parameters. For example, sample means are used to estimate population means; sample proportions, to estimate population proportions.
An estimate of a population parameter may be expressed in two ways:
  • Point estimate. A point estimate of a population parameter is a single value of a statistic. For example, the sample mean x is a point estimate of the population mean μ. Similarly, the sample proportion p is a point estimate of the population proportion P.
  • Interval estimate. An interval estimate is defined by two numbers, between which a population parameter is said to lie. For example, a < x < b is an interval estimate of the population mean μ. It indicates that the population mean is greater than a but less than b.

Discrete vs. Continuous Random Variables

When the numerical value of a variable is determined by a chance event, that variable is called a random variable.
Discrete vs. Continuous Random Variables
Random variables can be discrete or continuous.
  • Discrete. Discrete random variables take on integer values, usually the result of counting. Suppose, for example, that we flip a coin and count the number of heads. The number of heads results from a random process - flipping a coin. And the number of heads is represented by an integer value - a number between 0 and plus infinity. Therefore, the number of heads is a discrete random variable.
  • Continuous. Continuous random variables, in contrast, can take on any value within a range of values. For example, suppose we flip a coin many times and compute the average number of heads per flip. The average number of heads per flip results from a random process - flipping a coin. And the average number of heads per flip can take on any value between 0 and 1, even a non-integer value. Therefore, the average number of heads per flip is a continuous random variable.

Statistics Tutorial: Attributes of Random Variables

Just like variables from a data set, random variables are described by measures of central tendency (i.e., mean and median) and measures of variability (i.e., standard deviation and variance). This lesson shows how to compute these measures for discrete random variables.

Mean of a Discrete Random Variable

The mean of the discrete random variable X is also called the expected value of X. Notationally, the expected value of X is denoted by E(X). Use the following formula to compute the mean of a discrete random variable.
E(X) = μx = Σ [ xi * P(xi) ]
where xi is the value of the random variable for outcome i, μx is the mean of random variable X, and P(xi) is the probability that the random variable will be outcome i.
Median of a Discrete Random Variable
The median of a discrete random variable is the "middle" value. It is the value of X for which P(X < x) is greater than or equal to 0.5 and P(X > x) is greater than or equal to 0.5.
Consider the problem presented above in Example 1. In Example 1, the median is 2; because P(X < 2) is equal to 0.60, and P(X > 2) is equal to 0.70. The computations are shown below.
P(X < 2) = P(x=0) + P(x=1) + P(x=2) = 0.10 + 0.20 + 0.30 = 0.60

P(X > 2) = P(x=2) + P(x=3) + P(x=4) = 0.30 + 0.25 + 0.15 = 0.70
Variability of a Discrete Random Variable
The standard deviation of a discrete random variable (σ) is equal to the square root of the variance of a discrete random variable (σ2). The equation for computing the variance of a discrete random variable is shown below.
σ2 = Σ [ xi - E(x) ]2 * P(xi)
where xi is the value of the random variable for outcome i, P(xi) is the probability that the random variable will be outcome i, E(x) is the expected value of the discrete random variable x.

Statistics Tutorial: Chi-Square Distribution

Statistics Tutorial: Chi-Square Distribution
Suppose we conduct the following statistical experiment. We select a random sample of size n from a normal population, having a standard deviation equal to σ. We find that the standard deviation in our sample is equal to s. Given these data, we can define a statistic, called chi-square, using the following equation:
Χ2 = [ ( n - 1 ) * s2 ] / σ2
If we repeated this experiment an infinite number of times, we could obtain a sampling distribution for the chi-square statistic. The chi-square distribution is defined by the following probability density function:
Y = Y0 * ( Χ2 ) ( v/2 - 1 ) * e-Χ2 / 2
where Y0 is a constant that depends on the number of degrees of freedom, Χ2 is the chi-square statistic, v = n - 1 is the number of degrees of freedom, and e is a constant equal to the base of the natural logarithm system (approximately 2.71828). Y0 is defined, so that the area under the chi-square curve is equal to one.
In the figure below, the red curve shows the distribution of chi-square values computed from all possible samples of size 3, where degrees of freedom is n - 1 = 3 - 1 = 2. Similarly, the the green curve shows the distribution for samples of size 5 (degrees of freedom equal to 4); and the blue curve, for samples of size 11 (degrees of freedom equal to 10).
The chi-square distribution has the following properties:
  • The mean of the distribution is equal to the number of degrees of freedom: μ = v.
  • The variance is equal to two times the number of degrees of freedom: σ2 = 2 * v
  • When the degrees of freedom are greater than or equal to 2, the maximum value for Y occurs when Χ2 = v - 2.
  • As the degrees of freedom increase, the chi-square curve approaches a normal distribution.
Cumulative Probability and the Chi-Square Distribution
The chi-square distribution is constructed so that the total area under the curve is equal to 1. The area under the curve between 0 and a particular chi-square value is a cumulative probability associated with that chi-square value. For example, in the figure below, the shaded area represents a cumulative probability associated with a chi-square statistic equal to A; that is, it is the probability that the value of a chi-square statistic will fall between 0 and A.

Statistics Tutorial: Chi-Square Distribution
Suppose we conduct the following statistical experiment. We select a random sample of size n from a normal population, having a standard deviation equal to σ. We find that the standard deviation in our sample is equal to s. Given these data, we can define a statistic, called chi-square, using the following equation:
Χ2 = [ ( n - 1 ) * s2 ] / σ2
If we repeated this experiment an infinite number of times, we could obtain a sampling distribution for the chi-square statistic. The chi-square distribution is defined by the following probability density function:
Y = Y0 * ( Χ2 ) ( v/2 - 1 ) * e-Χ2 / 2
where Y0 is a constant that depends on the number of degrees of freedom, Χ2 is the chi-square statistic, v = n - 1 is the number of degrees of freedom, and e is a constant equal to the base of the natural logarithm system (approximately 2.71828). Y0 is defined, so that the area under the chi-square curve is equal to one.
In the figure below, the red curve shows the distribution of chi-square values computed from all possible samples of size 3, where degrees of freedom is n - 1 = 3 - 1 = 2. Similarly, the the green curve shows the distribution for samples of size 5 (degrees of freedom equal to 4); and the blue curve, for samples of size 11 (degrees of freedom equal to 10).
The chi-square distribution has the following properties:
  • The mean of the distribution is equal to the number of degrees of freedom: μ = v.
  • The variance is equal to two times the number of degrees of freedom: σ2 = 2 * v
  • When the degrees of freedom are greater than or equal to 2, the maximum value for Y occurs when Χ2 = v - 2.
  • As the degrees of freedom increase, the chi-square curve approaches a normal distribution.
Cumulative Probability and the Chi-Square Distribution
The chi-square distribution is constructed so that the total area under the curve is equal to 1. The area under the curve between 0 and a particular chi-square value is a cumulative probability associated with that chi-square value. For example, in the figure below, the shaded area represents a cumulative probability associated with a chi-square statistic equal to A; that is, it is the probability that the value of a chi-square statistic will fall between 0 and A.


Binomial-Distribution

<a title="View Binomial Distribution on Scribd" href="http://www.scribd.com/doc/45040384/Binomial-Distribution" style="margin: 12px auto 6px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block; text-decoration: underline;">Binomial Distribution</a> <object id="doc_134318068057637" name="doc_134318068057637" height="600" width="100%" type="application/x-shockwave-flash" data="http://d1.scribdassets.com/ScribdViewer.swf" style="outline:none;" >  <param name="movie" value="http://d1.scribdassets.com/ScribdViewer.swf">  <param name="wmode" value="opaque">   <param name="bgcolor" value="#ffffff">   <param name="allowFullScreen" value="true">   <param name="allowScriptAccess" value="always">   <param name="FlashVars" value="document_id=45040384&access_key=key-pv5n57bfu5ha30g540n&page=1&viewMode=list">   <embed id="doc_134318068057637" name="doc_134318068057637" src="http://d1.scribdassets.com/ScribdViewer.swf?document_id=45040384&access_key=key-pv5n57bfu5ha30g540n&page=1&viewMode=list" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="600" width="100%" wmode="opaque" bgcolor="#ffffff"></embed>  </object>

Baye-s-Theorem

<a title="View Baye's Theorem on Scribd" href="http://www.scribd.com/doc/45040378/Baye-s-Theorem" style="margin: 12px auto 6px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block; text-decoration: underline;">Baye's Theorem</a> <object id="doc_243341125756167" name="doc_243341125756167" height="600" width="100%" type="application/x-shockwave-flash" data="http://d1.scribdassets.com/ScribdViewer.swf" style="outline:none;" >  <param name="movie" value="http://d1.scribdassets.com/ScribdViewer.swf">  <param name="wmode" value="opaque">   <param name="bgcolor" value="#ffffff">   <param name="allowFullScreen" value="true">   <param name="allowScriptAccess" value="always">   <param name="FlashVars" value="document_id=45040378&access_key=key-24b3u2wwvcbigdp7h1ml&page=1&viewMode=list">   <embed id="doc_243341125756167" name="doc_243341125756167" src="http://d1.scribdassets.com/ScribdViewer.swf?document_id=45040378&access_key=key-24b3u2wwvcbigdp7h1ml&page=1&viewMode=list" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="600" width="100%" wmode="opaque" bgcolor="#ffffff"></embed>  </object>