Click here to load reader

View

219Download

0

Embed Size (px)

DESCRIPTION

T Test Analysis

t-testTesting Inferences about Population Means

By: Agus Aan Adriansyah

*Today were going to talk about the two sample t-tests. This is the simplest test used to make inferences about population means.

Learning ObjectivesMenghitung dan menginterpretasiSingle sample tIndependent samples tDependent samples tMenggunakan SPSS untuk menghitung tes yang sama dan menginterpretasi output

*You should be able to do all independent and dependent t-tests by hand and to interpret the results correctly. After doing them by hand, you will learn how to use SPSS to do the work for you.

Review 6 Steps for Significance TestingMenentukan alpha (p level).Menyatakan hipotesis, null dan alternatif.Menghitung statistik uji (sample value).Menentukan nilai kritis statistik.Menyatakan peraturan keputusan.Menyatakan kesimpulan.

*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 exampleHo: mu = 1000 hoursH1: mu is not equal to 1000 hours3. 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.

One Sample Exercise (1)Menentukan alpha. = .05Menyatakan hypotheses. Null hypothesis is H0: = 1000.Alternative hypothesis is H1: 1000.

Menghitung statistik ujiMenguji apakah bola lampu mempunyai umur 1000 jam

*Lets do the steps:1. Set alpha = .05. If there is no difference, we will be wrong only 5 times in 100.2. State hypotheses. (Null) H0: = 1000. (Alternative) H1: 1000. We are testing to see if our light bulbs came from a population where average life is 1000 hours.3. Calculate the test statistic.

Calculating the Single Sample tBerapa mean sampel? = 867Berapa standar deviasi sampel bola lampu?SD= 96.73

8007509409707909808207601000860

*Go over the answers to exercise with them.M = 867SD = 96.7299SE= 30.58867t = -4.35Reject H0Bulbs were not drawn from population with 1000 hr life.Any questions?

Determining SignificanceMenentukan nilai kritis. Lihat pada tabel. Mencari alpha = .05, two tails dengan df = 10-1 = 9. Pada tabel 2.262.Menyatakan peraturan keputusan. Jika nilai absolut dari sampel lebih besar dari nilai kritis, Null ditolak. If |-4.35| > |2.262|, H0 ditolak.

*4. Determine the critical value of the statistic. We look this up in a table. We need to know alpha (.05, two-tailed) and the degrees of freedom (df). For this test, the df are N-1, in our case 10-1 = 9. According to the table, the critical value is 2.262.5. State the decision rule: If the absolute value of the test statistic is greater that the critical value, we reject the null hypothesis. In our case, if |-.33| is greater than 2.262, we reject the hypothesis that = 1000. This is not the case here.

Stating the Conclusion6. Menyatakan kesimpulan. Kami menolak hipotesis nol bahwa lampu yang diambil dari populasi yang rata-rata berumur 1000 jam. Perbedaan antara rata-rata sampel (867) dan rata-rata populasi (1000) sangat berbeda yang tidak mungkin bahwa sampel bisa saja diambil dari populasi dengan rata-rata berumur 1000 jam.

*State the conclusion. Our results suggest that GEs claim that their light bulbs last 1,000 hours is FALSE. (because we had a sample of 10 GE light bulbs and our sample mean was so far away from 1,000 hours that it is highly unlikely that these bulbs came from a population of bulbs whose mean is really 1,000.) There is a 5% chance that this conclusion is wrong (I.e., we may have gotten a difference this big just by chance factors alone).

SPSS ResultsComputers print p values rather than critical values. If p (Sig.) is less than .05, its significant.

*On Brannicks website, Research Methods, Labs, Lab Presentations. Click on Lab 5 SPSS Examples, the Open. SPSS should run and the data for this lab should appear. In the middle is the column ltbulb. This has the data for the ligtbulb example. In the SPSS data editor, click Analyze, Compare Means, One-Sample T Test. Select ltbulb and put it in the Test Variables box. Type 1000 in the Test Value box. Click OK. You get the output on this slide.

t-tests with Two SamplesIndependent Samples t-test

Dependent Samples t-test

*

Independent Samples t-testDigunakan ketika memiliki dua sampel independen, mis. Kelompok perlakuan dan kelompok kontrol.Rumus:Istilah dalam pembilang adalah mean sampel. Istilah dalam penyebut adalah standar eror selisih mean.

*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.

Independent samples t-testRumus standar eror selisih mean:Misalkan kita mempelajari pengaruh kafein pada tes motorik dimana tugas ini adalah untuk menjaga mouse berpusat pada titik yang bergerak. Semua orang mendapat minuman; setengah mendapatkan kafein, setengah mendapatkan plasebo; tidak ada yang tahu siapa yang mendapat apa.

*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 wont be exactly zero, however. The amount that the difference wanders from zero on average is , the standard error of the difference.

Independent Sample Data (Data are time off task)

Experimental (Caff)Control (No Caffeine)122114181014820161151938912111315N1=9, M1=9.778, SD1=4.1164N2=10, M2=15.1, SD2=4.2805

*So lets 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, its a placebo. Nobody in the study knows who got what. All take the test. The results are in the slide.

Independent Sample Steps(1)Menentukan alpha. Alpha = .05Menyatakan 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

Independent Sample Steps(2)3. Menghitung statistik uji:

*3.Calculate the test statistic (see the slide).

Independent Sample Steps (3)Menentukan nilai kritis. Alpha .05, 2 tails, dan df = N1+N2-2 or 10+9-2 = 17. Hasilnya 2.11.Menentukan keputusan peraturan. Jika |-2.758| > 2.11, maka null ditolak.Kesimpulan: Null ditolak. Mean populasi berbeda. Kafein memiliki efek pada motorik.

*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 2.110.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.

Using SPSSBuka SPSSBuka file SPSS Examples untuk Lab 5Go to:Analyze kemudian Compare MeansPilih Independent samples t-testMasukkan IV dalam grouping variable dan DV dalam kotak test variable. Mendefinisikan pengelompokan nomor variabel.

Misal, experimental group sebagai 1 dalam kumpulan data dan control group sebagai 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.

Independent Samples ExerciseKerjakan soal ini secara manual dan SPSS. Anda harus memasukkan data ke SPSS.

Experimental Control12201418101482016

*Have them work this one. Assume again that this is time off task for the DV.Here are the answers for the independent samples exerciseM1 = 12, M2 = 18SD1 = 3.162278, SD2 = 2.8284227Std Error = 2t = -6/2 = -3; df = 5 + 4 - 2 = 7t(.05) = 2.3646; 3 > 2.3646Reject null hypothesisWe 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 Levenes test. Explain that if the Levenes test is significant, we need to use the row that says equal variances NOT assumed. We do NOT want the Levenes test to be significant as it violates an assumption of the t-test.

SPSS Results

*

Dependent Samples t-tests

*

Dependent Samples t-testDigunakan ketika memiliki sampel dependen - matched, paired or tied pengukuran berulangKakak & adik, suami & istriTangan kiri, tangan kanan, dan lain-lainBerguna untuk mengontrol perbedaan individu. Dapat menghasilkan tes yang lebih kuat daripada sampel independen 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.]

Dependent Samples tRumus:t adalah selisih mean dan standar erorStandar eror ditemukan dengan mencari perbedaan antara masing-masing pasangan pengamatan. Standar deviasi perbedaan ini adalah SDD. Membagi SDD dengan sqrt (jumlah pasangan) untuk mendapatkan SEdiff.

*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.

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.

Dependent Samples t example

PersonBeforeAfterDifference16055523520153706010450455560600M55487SD13.2316.815.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.)

Dependent Samples t Example (2)Menentukan alpha = .05Null hypothesis: H0: 1 = 2. Alternative is H1: 1 2. Menghitung statistik uji:

*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).

Dependent Samples t Example (3)Menentukan nilai kritis t. Alpha =.05, tails=2 df = N(pairs)-1 =5-1=4. Nilai kritis 2.776

Peraturan keputusan: Apakah nilai mutlak dari nilai sampel lebih besar dari nilai kritis?

Kesimpulan. Tidak (terlalu) signifikan. Painfree tidak memiliki efek.

*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 2.776.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.

Using SPSS for dependent t-testBuka SPSSBuka file SPSS Examples (sama seperti sebelumnya)Go to:Analyze kemudian Compare MeansPilih Paired samples t-test Pilih dua kondisi IV yang akan dibandingkan. Masukkan dalam 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.]

Dependent t- SPSS output

*Go over output. Have them start on their homework or project.

*Today were going to talk about the two sample t-tests. This is the simplest test used to make inferences about population means.*You should be able to do all independent and dependent t-tests by hand and to interpret the results correctly. After doing them by hand, you will learn how to use SPSS to do the work for you. *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 exampleHo: mu = 1000 hoursH1: mu is not equal to 1000 hours3. 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. *Lets do the steps:1. Set alpha = .05. If there is no difference, we will be wrong only 5 times in 100.2. State hypotheses. (Null) H0: = 1000. (Alternative) H1: 1000. We are testing to see if our light bulbs came from a population where average life is 1000 hours.3. Calculate the test statistic.

*Go over the answers to exercise with them.M = 867SD = 96.7299SE= 30.58867t = -4.35Reject H0Bulbs were not drawn from population with 1000 hr life.Any questions?*4. Determine the critical value of the statistic. We look this up in a table. We need to know alpha (.05, two-tailed) and the degrees of freedom (df). For this test, the df are N-1, in our case 10-1 = 9. According to the table, the critical value is 2.262.5. State the decision rule: If the absolute value of the test statistic is greater that the critical value, we reject the null hypothesis. In our case, if |-.33| is greater than 2.262, we reject the hypothesis that = 1000. This is not the case here.*State the conclusion. Our results suggest that GEs claim that their light bulbs last 1,000 hours is FALSE. (because we had a sample of 10 GE light bulbs and our sample mean was so far away from 1,000 hours that it is highly unlikely that these bulbs came from a population of bulbs whose mean is really 1,000.) There is a 5% chance that this conclusion is wrong (I.e., we may have gotten a difference this big just by chance factors alone). *On Brannicks website, Research Methods, Labs, Lab Presentations. Click on Lab 5 SPSS Examples, the Open. SPSS should run and the data for this lab should appear. In the middle is the column ltbulb. This has the data for the ligtbulb example. In the SPSS data editor, click Analyze, Compare Means, One-Sample T Test. Select ltbulb and put it in the Test Variables box. Type 1000 in the Test Value box. Click OK. You get the output on this slide.*

*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.*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 wont be exactly zero, however. The amount that the difference wanders from zero on average is , the standard error of the difference.*So lets 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, its a placebo. Nobody in the study knows who got what. All take the test. The results are in the slide. *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 *3.Calculate the test statistic (see the slide).*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 2.110.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.*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.*Have them work this one. Assume again that this is time off task for the DV.Here are the answers for the independent samples exerciseM1 = 12, M2 = 18SD1 = 3.162278, SD2 = 2.8284227Std Error = 2t = -6/2 = -3; df = 5 + 4 - 2 = 7t(.05) = 2.3646; 3 > 2.3646Reject null hypothesisWe 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 Levenes test. Explain that if the Levenes test is significant, we need to use the row that says equal variances NOT assumed. We do NOT want the Levenes test to be significant as it violates an assumption of the 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.]*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.*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.*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.) *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).*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 2.776.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.*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.]*Go over output. Have them start on their homework or project.