Download presentation
Presentation is loading. Please wait.
1
t-test Dr. Hamza Aduraidi
2
Review 6 Steps for Significance Testing
Set alpha (p level). State hypotheses, Null and Alternative. Calculate the test statistic (sample value). Find the critical value of the statistic. State the decision rule. State the conclusion. 1. Set Alpha level, probability of Type I error, that is probability that we will conclude there is a difference when there really is not. Typically set at .05, or 5 chances in 100 to be wrong in this way. 2. State hypotheses. Null hypothesis: represents a position that the treatment has no effect. Alternative hypothesis is that the treatment has an effect. In the light bulb example Ho: mu = 1000 hours H1: mu is not equal to 1000 hours 3. Calculate the test statistic. (see next slide for values) 4. Determine the critical value of the statistic. 5. State the decision rule: e.g., if the statistic computed is greater than the critical value, then reject the null hypothesis. Conclusion: the result is significant or it is not significant. Write up the results.
3
t-test t –test is about means: distribution and evaluation for group distribution Withdrawn form the normal distribution The shape of distribution depend on sample size and, the sum of all distributions is a normal distribution t- distribution is based on sample size and vary according to the degrees of freedom
4
What is the t -test t test is a useful technique for comparing mean values of two sets of numbers. The comparison will provide you with a statistic for evaluating whether the difference between two means is statistically significant. t test is named after its inventor, William Gosset, who published under the pseudonym of student. t test can be used either : to compare two independent groups (independent-samples t test) to compare observations from two measurement occasions for the same group (paired-samples t test).
5
What is the t -test The null hypothesis states that any difference between the two means is a result to difference in distribution. Remember, both samples drawn randomly form the same population. Comparing the chance of having difference is one group due to difference in distribution. Assuming that both distributions came from the same population, both distribution has to be equal.
6
What is the t -test Then, what we intend:
“To find the difference due to chance” Logically, The larger the difference in means, the more likely to find a significant t test. But, recall: Variability More variability = less overlap = larger difference 2. Sample size Larger sample size = less variability (pop) = larger difference
7
Types The independent-sample t test is used to compare two groups' scores on the same variable. For example, it could be used to compare the salaries of dentists and physicians to evaluate whether there is a difference in their salaries. The paired-sample t test is used to compare the means of two variables within a single group. For example, it could be used to see if there is a statistically significant difference between starting salaries and current salaries among the general physicians in an organization.
8
Assumption Dependent variable should be continuous (I/R)
The groups should be randomly drawn from normally distributed and independent populations e.g. Male X Female Dentist X Physician Manager X Staff NO OVER LAP
9
Assumption the independent variable is categorical with two levels
Distribution for the two independent variables is normal Equal variance (homogeneity of variance) large variation = less likely to have sig t test = accepting null hypothesis (fail to reject) = Type II error = a threat to power Sending an innocent to jail for no significant reason
10
Independent Samples t-test
Used when we have two independent samples, e.g., treatment and control groups. Formula is: Terms in the numerator are the sample means. Term in the denominator is the standard error of the difference between means. Here we have two different samples, and we want to know if they were drawn from populations with two different means. This is equivalent to saying whether a treatment has an effect given a treatment group and a control group. The formula for this t is on the slide. Here t is the test statistic, and the terms in the numerator are the sample and population means. The term in the denominator is SEdiff, which is the standard error of the difference between means. You can see from the subscripts for both t and SE, that we are now dealing with the Sampling Distribution of the DIFFERENCE between the means. This is very similar to the sampling distribution that we created last week. However, what we would do to create a sampling distribution of the differences between the means is rather than selecting 5 scores and computing a mean, we would select 5 pairs of scores, subtract one value from the other, then calculate the mean DIFFERENCE value. If we are doing a study and have two groups, what do we EXPECT that the difference in their mean scores will be? [They should say zero]. Thus, the mean of the sampling distribution of the differences between the means is zero. The subscripts are here to tell you which Sampling Distribution we are dealing with (for the Sampling Distribution of Means last week, we had a subscript X-bar. For the sampling distribution of the differences between the means, we have a notation specifying a difference, specifically, the difference between X-bar1 and X-bar2.
11
Independent samples t-test
The formula for the standard error of the difference in means: Suppose we study the effect of caffeine on a motor test where the task is to keep a the mouse centered on a moving dot. Everyone gets a drink; half get caffeine, half get placebo; nobody knows who got what. Suppose we have two samples taken from the same population. Suppose we compute the mean for each sample and subtract the mean for sample 2 from sample 1. We will get a difference between sample means. If we do this a lot, on average, that difference will be zero. Most of the time it won’t be exactly zero, however. The amount that the difference wanders from zero on average is , the standard error of the difference.
12
Independent Sample Data (Data are time off task)
Experimental (Caff) Control (No Caffeine) 12 21 14 18 10 8 20 16 11 5 19 3 9 13 15 N1=9, M1=9.778, SD1=4.1164 N2=10, M2=15.1, SD2=4.2805 So let’s say we do the following study. We bring in our volunteers and give each of them a psychomotor test where they use a mouse to keep a dot centered on a computer screen target that keeps moving away (pursuit task). One hour before the test, both groups get an oral dose of a drug. For every other person (1/2 of the people), the drug is caffeine. For the other half, it’s a placebo. Nobody in the study knows who got what. All take the test. The results are in the slide.
13
Independent Sample Steps(1)
Set alpha. Alpha = .05 State Hypotheses. Null is H0: 1 = 2. Alternative is H1: 1 2. 1. Set alpha = .05, two tailed (just a difference, not a prediction of greater n or less than). 2. Null Hypothesis: . This is the same as . This says that there is no difference between the drug group and the placebo group in psychomotor performance in the population. The alternative hypothesis is that the drug does have an effect, or
14
Independent Sample Steps(2)
Calculate test statistic: 3. Calculate the test statistic (see the slide).
15
Independent Sample Steps (3)
Determine the critical value. Alpha is .05, 2 tails, and df = N1+N2-2 or = 17. The value is 2.11. State decision rule. If |-2.758| > 2.11, then reject the null. Conclusion: Reject the null. the population means are different. Caffeine has an effect on the motor pursuit task. 4. Determine the critical value of the statistic. We look this up in a table. Alpha is .05, t is 2-tailed and the df are n1+n2-2, or in our case, 17. The critical value is 5. State the decision rule. If the absolute value of the test statistic is larger than the critical value, reject the null hypothesis. If |-2.758| > 2.110, reject the null. 6. Conclusion, the population means are different. The result is significant at p < .05.
16
…
17
Using SPSS Open SPSS Open file “SPSS Examples” for Lab 5 Go to:
“Analyze” then “Compare Means” Choose “Independent samples t-test” Put IV in “grouping variable” and DV in “test variable” box. Define grouping variable numbers. E.g., we labeled the experimental group as “1” in our data set and the control group as “2” Make sure that they look at the data in SPSS to see how the groups were defined and how that relates to the “define groups” task.
18
Independent Samples Exercise
Experimental Control 12 20 14 18 10 8 16 Have them work this one. Assume again that this is time off task for the DV. Here are the answers for the independent samples exercise M1 = 12, M2 = 18 SD1 = , SD2 = Std Error = 2 t = -6/2 = -3; df = = 7 t(.05) = ; 3 > Reject null hypothesis We conclude that caffeine has an effect. Be sure to cover the relevant areas of the SPSS printout. You should show them where everything that they calculate by hand is on the printout. Also cover the Levene’s test. Explain that if the Levene’s test is significant, we need to use the row that says ‘equal variances NOT assumed”. We do NOT want the Levene’s test to be significant as it violates an assumption of the t-test. Work this problem by hand and with SPSS. You will have to enter the data into SPSS.
19
SPSS Results
20
Dependent Samples t-tests
21
Dependent Samples t-test
Used when we have dependent samples – matched, paired or tied somehow Repeated measures Brother & sister, husband & wife Left hand, right hand, etc. Useful to control individual differences. Can result in more powerful test than independent samples t-test. We use this when we have measures on the same people in both conditions (or other dependency in the data). Usually there are individual differences among people that are relatively enduring. For example, suppose we tested the same people on the psychomotor test twice. Some people would be very good at it. Others would be relatively poor at it. The dependent t allows us to take these individual differences into account. The scores on the variable in one treatment will be correlated with the scores on the other treatment. If the observations are positively correlated (most people score either high on both or low on both) and if there is a difference in means, we are more likely to show it with the dependent t-test than with the independent samples t-test. [Emphasize this point, they need to know it for their homework.]
22
Dependent Samples t Formulas:
t is the difference in means over a standard error. We are still dealing with the Sampling Distribution of the Difference between the means. Our subscript is different here, but says basically the same thing. We are looking at the MEAN DIFFERENCE SCORE. The subscript for the independent samples t said we were looking at the DIFFERENCE BETWEEN THE MEANS. The standard error is found by finding the difference between each pair of observations. The standard deviation of these difference is SDD. Divide SDD by sqrt (number of pairs) to get SEdiff.
23
Another way to write the formula
In this formula, we just put the formula for Sediff in the denominator instead of having you calculate it separately. [this is the formula that appears on the “Guide to Statistics” sheet they can download.
24
Dependent Samples t example
Person Painfree (time in sec) Placebo Difference 1 60 55 5 2 35 20 15 3 70 10 4 50 45 M 48 7 SD 13.23 16.81 5.70 Suppose that we are testing Painfree, a drug to replace aspirin. Five people are selected to test the drug. On day one, ½ get painfree, and the other get a placebo. Then all put their hands into icewater until it hurts so bad they have to pull their hands from the water. We record how long it takes. The next day, they come back and take the other treatment. (Counterbalancing & double blind.)
25
Dependent Samples t Example (2)
Set alpha = .05 Null hypothesis: H0: 1 = 2. Alternative is H1: 1 2. Calculate the test statistic: 1. Set alpha = .05, two tailed (just a difference, not a prediction of greater or less than). 2. Null Hypothesis: This is the same as This says that there is no difference between the pain killer and the placebo in the population. The alternative hypothesis is that the pain killer does have an effect, or 3. Calculate the test statistic (see slide).
26
Dependent Samples t Example (3)
Determine the critical value of t. Alpha =.05, tails=2 df = N(pairs)-1 =5-1=4. Critical value is 2.776 Decision rule: is absolute value of sample value larger than critical value? Conclusion. Not (quite) significant. Painfree does not have an effect. 4. Determine the critical value of the statistic. We look this up in a table. Alpha is .05, t is 2-tailed and our df are N-1, where N is the number of pairs. In this case df = 5-1 = 4. The critical value is 5. State the decision rule. If the absolute value of the test statistic is larger than the critical value, reject the null hypothesis. If |2.75| > 2.776, reject the null. 6. Conclusion. he population means are not (quite) different. The result is not significant at p < .05.
27
Using SPSS for dependent t-test
Open SPSS Open file “SPSS Examples” (same as before) Go to: “Analyze” then “Compare Means” Choose “Paired samples t-test” Choose the two IV conditions you are comparing. Put in “paired variables box.” Point out that the data for an independent t-test and dependent t-test must be entered differently in SPSS. [They should choose “painfree” and “placebo” to put in the paired variables box.]
28
Dependent t- SPSS output
Go over output. Have them start on their homework or project.
29
Relationship between t Statistic and Power
To increase power: Increase the difference between the means. Reduce the variance Increase N Increase α from α = .01 to α = .05
30
To Increase Power Increase alpha, Power for α = .10 is greater than power for α = .05 Increase the difference between means. Decrease the sd’s of the groups. Increase N.
31
Independent t-Test
32
Independent t-Test: Independent & Dependent Variables
33
Independent t-Test: Define Groups
34
Independent t-Test: Options
35
Independent t-Test: Output
Are the groups different? t(18) = .511, p = .615 NO DIFFERENCE 2.28 is not different from 1.96
36
Dependent or Paired t-Test: Define Variables
37
Dependent or Paired t-Test: Select Paired-Samples
38
Dependent or Paired t-Test: Select Variables
39
Dependent or Paired t-Test: Options
40
Dependent or Paired t-Test: Output
Is there a difference between pre & post? t(9) = , p = .001 Yes, 4.7 is significantly different from 6.2
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.