Chi-Square Goodness-of-Fit (also referred to a Pearson’s Chi-Square Test) is a statistical method for determining how an actual or observed distribution of categorical variables relates to a theoretical distribution of those same variables. The Chi-Square Test is a non-parametric test meaning that its graph is not expected to approximate a normal distribution curve. An example of the shape of the graphs is to the right. Negative values for a Chi-Square test are impossible so Chi-Square test for goodness-of-fit is never a double-tailed test. This Chi-Square test is appropriate for two or more categorical variables with conditions requiring that the observed distribution or population has been randomly collected and that fewer than 1/5 of the categories being compared have fewer than 5 observations and that at least one observation is expected in every category. The degrees of freedom for a chi-square goodness-of-fit test are the number of categories minus 1. For example, if testing a standard die with six sides, there are six possible categories (1-6) so the degrees of freedom associated with this particular test would be 6-1 = 5.

Chi-Squared (X^2) is equal to the sum of the categories Observed minus Expected, squared, and then divided by the expected.

X^2 = (Observed – Expected)^2 / Expected.

This is performed for each category and then the Chi-Squared’s (X^2) are summed together and their significance is found by consulting a chi-square chart, finding the appropriate degrees of freedom row, and then finding where your summed Chi-Square term falls in the columns. This will provided the p-value for your Chi-Square Goodness-of-Fit Test.

The wikipedia article on the Chi-Square Goodness-of-Fit Test (they refer to it as Pearson’s Chi-Squared Test, it is the same thing) is an exhaustive analysis and explanation but is perhaps too technical for a good introduction or support for new students. This Rice University BioScience Department Website has a much simpler introduction and example that might be more appropriate for new students or those not specializing in mathematics. Another excellent analysis of the Chi-Square Goodness-of-Fit test in step-by-step lecture notes posted online from a University of California-Irvine class may be helpful as well.

]]>The picture to the right is William Sealy Gosset, who under the pen name “Student” developed the t test.

There are 5 steps to a hypothesis Test.

Remember, we are performing this test on our new calculated variable, . To perform a hypothesis test for paire means, apply the one-sample t procedures to the list of the differences for each pair.

**Claims**:

List the what your null hypothesis and alternate hypothesis are in this step.

Remember to include a full sentence describing what the null hypothesis means, in context. We are saying that the null hypothesis is that the mean value of the differences between our matched pairs are zero (or whatever value makes sense to use, in context. Zero is standard if we do not have another estimate already. This is saying that there is in fact NO difference between the two results for each pair).

Again remember to include a full sentence describing what the alternate hypothesis means, in context. Here, we are saying that the mean value of the differences between our matched pairs are different from the null hypothesis, so either greater than, less than, or not equal to whatever we defined in the null hypothesis.

**Conditions**:

1. Random? Each pair of measurements must be random. This site provides good information about randomization in matched pairs design (and also provides some sample questions to help you ensure you know when to use a paired samples test). Be sure to include any possible problems with the randomization.

2. 10% Condition? Our population must be larger than 10 times our sample. Be sure to include a discussion of what the population is and how we know our sample is an okay size.

3. Approximately normal? (this is for our new variable, d, the difference between the values for each pair). We will use the QQ plot and the histogram to show that the sample is nearly normal, unless . By the central limit theorem, when is greater than 40, our sample is approximately normal. This step insures that we can use a t distribution to reach a conclusion on the truth of the null hypothesis.

**Calculations**:

Remember degrees of freedom!!

Where the numerator is the difference between the sample mean and the population mean (which comes from our null hypothesis, usually this will be a zero). The denominator is our standard error for our test statistic, and we find it by dividing the standard error by the square root of the sample size.

Also include a model of the distribution and shade where appropriate. Include the p-value that results from the test statistic you find using the formula.

**Conclusion**:

For the conclusion, use the sentence we have for all hypothesis tests.

“Because my p-value of ____ is (greater than, less than) an alpha of 0.05 (or whatever you use as your standard), I (reject the null/fail to reject the null). The evidence does/does not seem to suggest that there is a difference between the two treatments (this part must be in context. For example, Because my p-value of 0.1986 is larger than an alpha of 0.05, I fail to reject the null. The evidence does not seem to suggest that a scented room helps students do better on tests.). Make sure you include the direction in which you subtracted. Because if there is in fact a difference, it matters in which way you subtracted to help the reader draw conclusions.

**To complete the paired test in SPSS follow these steps:**

Transform -> Compute Variable -> Target variable “d” -> subtract your variables in the compute field, and make sure to note which you are subtracting from the other.

Next, go to Analyze -> Descriptive Statistics -> explore and select d as the dependent list.

also select the plots option ->and check histogram and normality plot.

Next Analyze -> Compare means -> Paired samples t test.

Choose variables based on the order you want to subtract (this can help your interpretation of the results of the test if you subtract in a certain order).

Run the test.

This site provides a nice example of a matched pairs design. It can give you a concrete idea of how a matched pairs test would be used in real life and it also includes some good commentary on randomization when conducting a matched pairs experiment.

This site goes very in-depth and explains all aspects of the paired means t test. If you are confused about any aspect of this test, this webpage will probably have the answer. It includes examples and a thorough explanation of everything pertaining to the hypothesis test.

]]>Before we create a confidence interval for a single proportion and claim it to be true, for the interval to be valid, we must check some conditions: First, is our sample a random sample of the population? This must be true for our interval to truly represent the entire population. Second, is the sample size under 10% of the entire population? It must be independent of other events. Thirdly, and lastly, are there at least 10 successes and 10 failures in the sample? Only then can we have an unbiased sample.

Now that we have met our conditions, it is now time to calculate the interval. Before getting into the equations, we basically have our (which is our sample proportion) the margin of error making up our interval.

Finally, the last step is the conclusion. Depending on your confidence level you have chosen, you are that percentage sure that the interval you have calculated captures the true population proportion.

Summary of the three steps:

1. Check Conditions

- Is this a random sample?
- Is the sample population n less than or equal to 10% of the entire population N?
- Is ?
- Is ?

2. Calculate

The is the formula for the standard error for a single proportion. It is a measurement of the standard deviation of the sampling distribution of the sample proportion.

You get your from the confidence level you choose. Use the chart below.

3. Conclusion

Fill in the blanks for your specific proportion interval: We are _____% confident that the interval (___,___) captures the true ____.

Make sure that your interval is in percentages in the conclusion because when you are talking to people, percentages make more sense than decimal numbers.

For the steps, this site is useful with more explanations as is this one for calculating which also needs something like this or just the chart above.

]]>**1. Create you hypothesis:**

You will have state a null hypothesis which will be what you expect to occur. You should write your null hypothesis in sentence form and in a mathematical formula; as shown below.

Hence the probability of both variables success rate is the same.

Your alternate hypothesis can be written in three different forms depending how you want to test your data. Depending if you’d like to test your data with a two-tailed test, or a one-tailed test. You should also write your null hypothesis in sentence form, and also in a mathematical formula; as shown below.

Case (1):

Case(2):

Case(3):

**2.Check Sampling Conditions**

The first condition you should check is to make sure that your sample was randomly selected. You also want to check the independence condition to ensure that your sample is not more than 10% of the total population. If those conditions are met you then want to check the Success/Failure condition. When you are using this specific hypothesis test we will pool our success and failure values for each group. Pooling in shown in the equations below.

(for successes)

(for failures)

Success Failure Condition (must pass each case):

**3. Calculate your test statistic**. Your test statistic is a numerical summary of a data set, that reduces the data to one value; which can be used to preform a hypothesis test it says here. Equation for test statistic:

$latex Z = \frac{ (\hat{p}_{1} – \hat{p}_{2}) – (p_{1} – p_{2})}{ \sqrt{ \frac{\hat{p}_{pooled} \cdot \hat{q}_{pooled}}{n_{1}}+\frac{\hat{p}_{pooled} \cdot \hat{q}_{pooled}}{n_{2}}}}$

**4. Sketch a normal model & find your p-value.**

Using our test statistic Z we can use SPSS and find our p-value. With these pieces of information we can sketch a Normal distribution.

**5. Conclusion**

If your p-value < than you can reject your null hypothesis. If your p-value > than you will report that you have failed to reject your null hypothesis. You must make sure you express this in a contextual meaningful way with regards to what your research is dealing with.

You can find more information and help with using this test here. As pooling is specific to this type of hypothesis test, here is a link that provides more information on pooling and when to use it.

` `

` `

As always, there are conditions that must be met for the inference to be valid. In this case, we must meet the random condition, 10% condition, and “nearly normal” condition. All of these conditions must be met on both samples.

The confidence interval itself is defined as:

,

where , , , , , and are derived easily from the two samples gathered. is best computed by SPSS (even the number of degrees of freedom is determined only by a complicated formula).

The conclusion should be stated carefully to avoid confusion. A template for the conclusion may be: “We are ___% confident that the value by which [the mean of the first population] is greater than [the mean of the second population] is captured in this interval.” Special attention should be given to which mean is the “first” and which is the “second” to help ensure it is obvious which mean is greater (in a given data set, which sample is greater is almost certainly an important research question or at least a key observation).

]]>The calculation for a confidence interval for two independent proportions is fairly straightforward with a little hiccup at the standard error (standard deviation of the sampling distribution). The equation is:

To help remember the standard error calculation, variances can sum. Adding the variances together gives the combined variance and then the standard deviation is just the square root of the variance.

Last, but most important, is the proper interpretation of this type of confidence interval. A confidence interval for two independent proportions is interpreted the same way as a single proportion confidence interval, except that there is an additional factor of direction. Without specifying the direction in which the difference of the proportions was taken ( vs. ) the interpretation is nearly worthless. Here is a good example of how to interpret this type of confidence interval. The linked example shows a situation where the confidence interval straddles a zero difference, which are particularly hard to interpret. Confidence intervals are most misused when they are not interpreted correctly. The second half of this article gives a few examples of poor interpretations.

*Remember that when we use the term proportion in statistics it implies a binary categorical variable; success/failure.

]]>- Can be used to compare a data set with a known value or null hypothesis.
- Used when a success/failure is easily applied to a single statistic.

There are 5 steps to the single proportion hypothesis test. First, a philosophical question has to be asked about what the statistician is attempting to show with the data, then a null and alternate hypothesis must be formed. The null hypothesis is either a known value or a hypothesized one. For example, they could be a cancer rate or a projected success rate in roulette. A good article on forming a hypothesis for single proportions can be found here.

Once the framework for the analysis is established, the statistician must check whether or not the data was random, that no more than 10% of the population was sampled, and they must check that the number of successes or failures times the the sample size (np^ and nq^) is greater than 10.

Next, we must calculate a test statistic, Z*. There is a good mathematical description in the link provided. The z score is used to show how confident we are that our data did not come about by mere chance, and it is used to find a P value.

We now use the test statistic to compare our data with the null hypothesis, and determine if we can reject or accept the null. One problem researchers tend to have with this method is using their hypothesized population values as the null hypothesis, and show that the data fails to reject the null, when it is not within the power of the test to show that the null is correct.

Finally, a conclusion based on the P value and alpha value can be made. In the end, there are two outcomes. We can reject the null or fail to reject the null.

]]>

“. A hypothesis test requires a single quantitative data set that will be analyzed, and a decision will be made regarding a claim about the population. Single mean hypothesis tests are a blunt tool to reject or fail to reject the null hypothesis, or original claim for the problem. It is good for broad decisions, but not to estimate the change in the sample. This website by Arkansas State University has a chapter from a statistics text book with good information regarding hypothesis tests.
The single mean hypothesis test is comprised of five steps: (1) Form a hypothesis, (2) Check conditions, (3) Calculate the test statistic, (4) Create the null distribution/ find the p-value, (5) Conclusion.

The test is as follows:

**1. Form a Hypothesis: **

In hypothesis testing, we form two hypotheses: the null hypothesis, (), and the alternate hypothesis, ().

: The null hypothesis is the initial claim about the population based on prior evidence. It is assumed to be true, unless we can provide evidence beyond reasonable doubt that would cause us to reject the null hypothesis.Be careful: the null can only be set equal to a certain value. It cannot be greater than or less than a value.

: The alternate hypothesis is the claim in opposition to the null hypothesis. It can be greater than, less than, or not equal to the value the null was set to.

Both the null and alternate hypothesis have to be stated in words, as well as symbolically. When the hypotheses are stated symbolically, is used because we are estimating the population.For example, if we want to test that 60% of eligible voters in Pakistan voted in the recent presidential election:

: = 0.60

In the recent Pakistani presidential election, 60% of eligible voters voted.

: 0.60

In the recent Pakistani presidential election, there were not 60% of eligible voters who voted.

**2. Check Conditions:**

In order to proceed with any hypothesis test, conditions need to be checked to see if the hypothesis test in question can be done. This ensures we have a reliable analysis of data.For hypothesis tests for a single mean, there are three conditions that need to be checked:

(i). Randomness – The sample has to be random and representative of the population being studied.

(ii). Independence- The total sample needs to be less than than 10% of the population being studied. (e.g. 9 eligible voters out of 100) Additionally, this means the probabilities of two events cannot be dependent on each other. A good example of this is when drawing cards out of a deck, the cards have to be put back into the deck, otherwise, the probability of drawing subsequent cards is changed.

(iii). Nearly normal sample distribution- For the real model to make sense, we need to know the population is normally distributed. This means the sample data is unimodal, symmetric, and there are no outliers. However, if the sample is larger than or equal to 40, the sample is large enough to yield a normal distribution. Additionally, we need a Q-Q plot, which compares the sample data points to where they should be on a normal model.

**3. Calculate the test statistic, t _{df} :
**

The test statistic gives a quantitative value to the behavior of the data. The University of North Carolina at Wilmington has good information on test statistics. For , “df” means degrees of freedom. The degrees of freedom in this case is n-1, where n is the number of events in the sample.

=

**4. Find the null distribution and the p-value:**

We use the test statistics and the degrees of freedom from the previous step to make a null distribution. There are infinitely many null distributions for the student t-test that are indexed by the degrees of freedom. The distributions are specific to the degrees of freedom, so this is an important part of the hypothesis test.

For example, if we had an alternate hypothesis that took a two-tailed, or $latex\neq$, counterpoint to the null hypothesis, and we found` = 1.75, the null distribution (also known as the t-distribution) will look like:`

The tales are shaded to the left of the t-value of -1.75, and to the right of the positive t-value of +1.75.

The shaded regions give us the **p-value**. The p-value is the probability, assuming the null hypothesis is true, of getting a sample that is as extreme or more extreme than that of the present sample

completely by chance.

The conclusion to a hypothesis test is determined by comparing the p-value found in the previous step to a significance level. The **significance level** is the probability that the null hypothesis is rejected even though it is true, and the probability that the researcher is wrong. It is the cutoff value for P that is chosen before the test is run, and it is the framework by which the null hypothesis is rejected, or if the researcher fails to reject the null. A common mistake that should never be made is to accept the null.

** **

Here are the cases for a conclusion to hypothesis testing:

P <α : Reject the null hypothesis

If the null is rejected, we conclude by using the following sentence as the template:

“There is sufficient evidence that is true”

P > α: Fail to reject the null hypothesis

If we fail to reject the null, we conclude by using the following sentence as the template:

“There is insufficient evidence that is true”

The conclusions should always be contextually meaningful. For another simple explanation of hypothesis testing, visit the University College Dublin Statistics Page. Another good website for single mean hypothesis testing is the Stat Trek website that provides explanations, as well as some good examples.

It is useful for predicting the interval in which the true mean will likely reside.

This is the process of going through this specific confidence interval:

1. Check your conditions

- random- Is your sample random and a good representation of the entire population?
- 10%- Is your sample ten percent or less than your population?
- nearly normal- Is your sample normally distributed? It is easy to check for this in SPSS if you were to look at the Q-Q plots of the data. If the dots are pretty close to the line and there are no apparent outliers then you are good.
- n≥40- If your sample is around forty or bigger then there is no need to check if it is nearly normal.

2. Calculation

- – This is the sample mean.
- – This is the margin of error. The t depends on the degrees of freedom, which is the sample size n minus one.
- interval:

3. Conclusion

- This will say something along the lines of “We are _____ % confident that the true population mean is captured in this interval.”

The t in step two is not easy to calculate and the use of SPSS will be needed as it changes from test to test. Here is a site that helps to understand confidence intervals in general and, if you do not see the “demo” button, this is a link to test out a confidence integral. Unless you sign in, you will not be able to use the full version. The demo lets you explore sample populations up to 150. There will be a place to specify the interval to a single mean. This is an one example for the confidence interval and this is another example that is more in depth and also has instructions for using minitab.

]]>- Check conditions.
- Random/10%: Check that both sets of data were collected randomly and are independent of other data. Also check that both samples do not make up more than 10% of their respective populations.
- Check one of the following:
- Nearly normal: Check that both sets of data appear to be normally distributed using histograms or QQ plots.
- Check that both sample sizes are greater than 40.

- Calculate the interval:
- In this situation, ‘s (degrees of freedom) calculation is complicated, so we usually just use a computer.

- Conclusion: Specify the direction/use in a contextual, full sentence.

It is important not to misinterpret the purpose or definition of a confidence interval. Another way to interpret a 90% confidence interval is: If we repeated the procedure with different samples, 9 out of 10 of them would result in confidence intervals that contained the difference of the true means, if those true means were known. A confidence interval does not predict future confidence intervals. It is also not an estimation of where the difference between the means of different samples most often lies, nor does it say anything about specific cases within the samples/population.

The informative leaflet “Common errors in the interpretation of survey data,” distributed by the State of Queensland’s Office of Economic and Statistical Research, covers some other ways that confidence intervals are misused. Wikipedia discusses alternatives to confidence intervals, which can be what is truly desired when a confidence interval is misused. For more tips on using confidence intervals, see the University of Minnesota’s page, “List of Tools for Confidence Intervals.”

]]>