34
REVIEW OF T-TESTS And then…..an “F” for everyone

Review of T-tests

  • Upload
    jewel

  • View
    32

  • Download
    0

Embed Size (px)

DESCRIPTION

Review of T-tests. And then…..an “F” for everyone. T-Tests. 1 sample t-test ( univariate t-test) Compare sample mean and population mean on same variable Assumes knowledge of population mean (rare) 2-sample t-test ( bivariate t-test) Compare two sample means (very common) - PowerPoint PPT Presentation

Citation preview

Page 1: Review of T-tests

REVIEW OF T-TESTSAnd then…..an “F” for everyone

Page 2: Review of T-tests

T-TESTS 1 sample t-test (univariate t-test)

Compare sample mean and population mean on same variable Assumes knowledge of population mean (rare)

2-sample t-test (bivariate t-test) Compare two sample means (very common) Nominal (Dummy) IV and I-R Dependent Variable

Difference between means across categories of IV Do males and females differ on #hours watching TV?

Page 3: Review of T-tests

THE T DISTRIBUTION Unlike Z, the t distribution

changes with sample size (technically, df)As sample size increases, the t-

distribution becomes more and more “normal”At df = 120, tcritical values are almost exactly the same as zcritical values

Page 4: Review of T-tests

T AS A “TEST STATISTIC”• All test statistics indicate how different our

finding is from what is expected under null– Mean differences under null hypothesis? ZERO– t indicates how different our finding is from zero

• There is an exact probability associated with every value of a test statistic– One route is to find a “critical value” for a test

statistic that is associated with stated alpha – What t value is associated with .05 or .01

– SPSS generates the exact probability associated with any value of a test statistic

Page 5: Review of T-tests

T-SCORE IS “MEANINGFUL” • Measure of difference in numerator (top

half) of equation • Denominator = convert/standardize

difference to “standard errors” rather than original metric– Imagine mean differences in “yearly income” versus

differences in “# cars owned in lifetime”• Very different metric, so cannot directly compare (e.g., a

difference of “2” would have very different meaning)• t = the number of standard errors that

separates means– One sample = x versus µ– Two sample = xmales vs. xfemales

Page 6: Review of T-tests

T-TESTING IN SPSS• Analyze compare means independent

samples t-test– Must define categories of IV (the dummy

variable)• How were the categories numerically coded?

• Output– Group Statistics = mean values – Levine’s test

• Not real important, if significant, use t-value and sig value from “equal variances not assumed” row

– t = “tobtained” • no need to find “t-critical” as SPSS gives you “sig” or the

exact probability of obtaining the tobtained under the null

Page 7: Review of T-tests

2-SAMPLE HYPOTHESIS TESTING IN SPSS Independent Samples t Test Output:

Testing the Ho that there is no difference in number the number of prior felonies in a sample of offenders who went through “drug court” as compared to a control group.

Group Statistics

group status N Mean

Std. Deviation

Std. Error Mean

Prior Felonies control 165 3.95 5.374 .418

drug court

167 2.71 3.197 .247

Page 8: Review of T-tests

INTERPRETING SPSS OUTPUT Difference in mean # of prior felonies between

those who went to drug court & control group

Independent Samples TestLevene's Test for Equality of

Variances t-test for Equality of Means95%

Confidence Interval of the

Difference

F Sig. t dfSig. (2-tailed)

Mean Difference

Std. Error Difference Lower Upper

Prior Felonies Equal variances assumed

29.035 .000 2.557 330 .011 1.239 .485 .286 2.192

Equal variances not assumed

2.549 266.536 .011 1.239 .486 .282 2.196

Page 9: Review of T-tests

INTERPRETING SPSS OUTPUT t statistic, with degrees of freedom

Independent Samples TestLevene's Test for Equality of

Variances t-test for Equality of Means95%

Confidence Interval of the

Difference

F Sig. t dfSig. (2-tailed)

Mean Difference

Std. Error Difference Lower Upper

Prior Felonies Equal variances assumed

29.035 .000 2.557 330 .011 1.239 .485 .286 2.192

Equal variances not assumed

2.549 266.536 .011 1.239 .486 .282 2.196

Page 10: Review of T-tests

INTERPRETING SPSS OUTPUT

Independent Samples TestLevene's Test for Equality of

Variances t-test for Equality of Means95%

Confidence Interval of the

Difference

F Sig. t dfSig. (2-tailed)

Mean Difference

Std. Error Difference Lower Upper

Prior Felonies Equal variances assumed

29.035 .000 2.557 330 .011 1.239 .485 .286 2.192

Equal variances not assumed

2.549 266.536 .011 1.239 .486 .282 2.196

“Sig. (2 tailed)”The exact probability of obtaining this mean difference (and associated t-value) under the null hypothesis

Page 11: Review of T-tests

SIGNIFICANCE (“SIG”) VALUE & PROBABILITY Number under “Sig.” column is the exact

probability of obtaining that t-value ( or of finding that mean difference) if the null is true When probability > alpha, we do NOT reject H0 When probability < alpha, we DO reject H0

As the test statistics (here, “t”) increase, they indicate larger differences between our obtained finding and what is expected under null Therefore, as the test statistic increases, the

probability associated with it decreases

Page 12: Review of T-tests

SPSS AND 1-TAIL / 2-TAIL SPSS only reports “2-tailed” significant tests To obtain a 1-tail test simple divide the “sig

value” in half Sig. (2 tailed) = .10 Sig 1-tail = .05 Sig. (2 tailed) = .03 Sig 1-tail = .015

Page 13: Review of T-tests

FACTORS IN THE PROBABILITY OF REJECTING H0 FOR T-TESTS

1. The size of the observed difference(s)

2. The alpha level

3. The use of one or two-tailed tests

4. The size of the sample

Page 14: Review of T-tests

SPSS EXAMPLE Data from one of our graduate students’

survey of you deviants. Go to www.d.umn.edu/~jmaahs and get

“t-test example” data and open into SPSS

H1: Sex is related to GPA H2: Those who use Adderall are more

likely to engage in other sorts of crime

Use Alpha = .01

Page 15: Review of T-tests

ANALYSIS OF VARIANCE What happens if you have more than two

means to compare? IV (grouping variable) = more than two

categories Examples

Risk level (low medium high) Race (white, black, native American, other)

DV Still I/R (mean)

Results in F-TEST

Page 16: Review of T-tests

ANOVA = F-TEST The purpose is very similar to the t-

test

HOWEVER Computes the test statistic “F” instead of “t”And does this using different logic because

you cannot calculate a single distance between three or more means.

Page 17: Review of T-tests

ANOVAWhy not use multiple t-tests?

Error compounds at every stage probability of making an error gets too large

F-test is therefore EXPLORATORYIndependent variable can be any level

of measurementTechnically true, but most useful if categories are limited (e.g., 3-5).

Page 18: Review of T-tests

HYPOTHESIS TESTING WITH ANOVA:Different route to calculate the test

statistic2 key concepts for understanding ANOVA:

SSB – between group variation (sum of squares)

SSW – within group variation (sum of squares)

ANOVA compares these 2 type of varianceThe greater the SSB relative to the SSW, the more likely that the null hypothesis (of no difference among sample means) can be rejected

Page 19: Review of T-tests

TERMINOLOGY CHECK “Sum of Squares” = Sum of Squared

Deviations from the Mean = (Xi - X)2

Variance = sum of squares divided by sample size = (Xi - X)2 = Mean Square

N Standard Deviation = the square root of

the variance = s

ALL INDICATE LEVEL OF “DISPERSION”

Page 20: Review of T-tests

THE F RATIO Indicates the variance between the

groups, relative to variance within the groups

F = Mean square between Mean square within

Between-group variance tells us how different the groups are from each other

Within-group variance tells us how different or alike the cases are as a whole sample

Page 21: Review of T-tests

EXAMPLE: BETWEEN-GROUP VS.WITHIN-GROUP VARIANCE

2 sets of statistics:A) Soph JuniorSeniorMean 4.0 5.1 4.7S.D. 0.8 1.0 1.2

B) Soph JuniorSeniorMean 4.0 9.3 8.2S.D. 0.5 0.7 0.5

Say we wanted to examine whether there are differences in the number of drinks consumed per week by year in school:

Page 22: Review of T-tests

ANOVAExample 2

Recidivism, measured as mean # of crimes committed in the year following release from custody: 90 individuals randomly receive 1of the following sentences:

Prison (mean = 3.4) Split sentence: prison & probation (mean = 2.5) Probation only (mean = 2.9)

These groups have different means, but ANOVA tells you whether they are statistically significant – bigger than they would be due to chance alone

Page 23: Review of T-tests

# OF NEW OFFENSES: DEMO OFBETWEEN & WITHIN GROUP VARIANCE

2.0 2.5 3.0 3.5 4.0

GREEN: PROBATION (mean = 2.9)

Page 24: Review of T-tests

# OF NEW OFFENSES: DEMO OFBETWEEN & WITHIN GROUP VARIANCE

2.0 2.5 3.0 3.5 4.0

GREEN: PROBATION (mean = 2.9)BLUE: SPLIT SENTENCE (mean = 2.5)

Page 25: Review of T-tests

# OF NEW OFFENSES: DEMO OFBETWEEN & WITHIN GROUP VARIANCE

2.0 2.5 3.0 3.5 4.0

GREEN: PROBATION (mean = 2.9)BLUE: SPLIT SENTENCE (mean = 2.5)RED: PRISON (mean = 3.4)

Page 26: Review of T-tests

# OF NEW OFFENSES: WHAT WOULD LESS “WITHIN GROUP VARIATION” LOOK LIKE?

2.0 2.5 3.0 3.5 4.0

GREEN: PROBATION (mean = 2.9)BLUE: SPLIT SENTENCE (mean = 2.5)RED: PRISON (mean = 3.4)

Page 27: Review of T-tests

ANOVAExample, continued

Differences (variance) between groups is also called “explained variance” (explained by the sentence different groups received).

Differences within groups (how much individuals within the same group vary) is referred to as “unexplained variance” Differences among individuals in the same group can’t

be explained by the different “treatment” (e.g., type of sentence)

Page 28: Review of T-tests

F STATISTIC

When there is more within-group variance than between-group variance, we are essentially saying that there is more unexplained than explained variance

In this situation, we always fail to reject the null hypothesis

This is the reason the F(critical) table (Healey Appendix D) has no values <1

Page 29: Review of T-tests

SPSS EXAMPLE Example:

1994 county-level data (N=295) Sentencing outcomes (prison versus other [jail or

noncustodial sanction]) for convicted felons Breakdown of counties by region:

REGION

67 22.7 22.7 22.743 14.6 14.6 37.3

140 47.5 47.5 84.745 15.3 15.3 100.0

295 100.0 100.0

MWNESWTotal

ValidFrequency Percent Valid Percent

CumulativePercent

Page 30: Review of T-tests

SPSS EXAMPLEQuestion: Is there a regional difference in the

percentage of felons receiving a prison sentence? (0 = none; 100 = all) Null hypothesis (H0):

There is no difference across regions in the mean percentage of felons receiving a prison sentence.

Mean percents by region:

Report

TOT_PRIS

44.033 66 21.608045.917 43 17.908058.236 140 27.024928.574 44 16.375148.775 293 25.4541

REGIONMWNESWTotal

Mean N Std. Deviation

Page 31: Review of T-tests

SPSS EXAMPLEThese results show that we can reject the null

hypothesis that there is no regional difference among the 4 sample means The differences between the samples are large enough

to reject Ho The F statistic tells you there is almost 20 X more between

group variance than within group variance The number under “Sig.” is the exact probability of obtaining this F by chance

ANOVA

TOT_PRIS

32323.544 3 10774.515 19.850 .000156866.3 289 542.790189189.8 292

Between GroupsWithin GroupsTotal

Sum ofSquares df Mean Square F Sig.

A.K.A. “VARIANCE”

Page 32: Review of T-tests

ANOVA: POST HOC TESTS The ANOVA test is exploratory

ONLY tells you there are sig. differences between means, but not WHICH means

Post hoc (“after the fact”) Use when F statistic is significant Run in SPSS to determine which means (of the 3+) are

significantly different

Page 33: Review of T-tests

OUTPUT: POST HOC TEST This post hoc test shows that 5 of the 6 mean differences

are statistically significant (at the alpha =.05 level) (numbers with same colors highlight duplicate comparisons)

p value (info under in “Sig.” column) tells us whether the difference between a given pair of means is statistically significant

Multiple Comparisons

Dependent Variable: TOT_PRISScheffe

-1.884 4.5659 .982 -14.723 10.956-14.203* 3.4787 .001 -23.985 -4.42115.460* 4.5343 .010 2.709 28.210

1.884 4.5659 .982 -10.956 14.723-12.319* 4.0620 .028 -23.742 -.89717.344* 4.9959 .008 3.295 31.39214.203* 3.4787 .001 4.421 23.98512.319* 4.0620 .028 .897 23.74229.663* 4.0266 .000 18.340 40.986

-15.460* 4.5343 .010 -28.210 -2.709-17.344* 4.9959 .008 -31.392 -3.295-29.663* 4.0266 .000 -40.986 -18.340

(J) REG_NUMNESWMWSWMWNEWMWNES

(I) REG_NUMMW

NE

S

W

MeanDifference

(I-J) Std. Error Sig. Lower Bound Upper Bound95% Confidence Interval

The mean difference is significant at the .05 level.*.

Page 34: Review of T-tests

ANOVA IN SPSS STEPS TO GET THE CORRECT OUTPUT…

ANALYZE COMPARE MEANS ONE-WAY ANOVA INSERT…

INDEPENDENT VARIABLE IN BOX LABELED “FACTOR:” DEPENDENT VARIABLE IN THE BOX LABELED “DEPENDENT

LIST:” CLICK ON “POST HOC” AND CHOOSE “LSD” CLICK ON “OPTIONS” AND CHOOSE “DESCRIPTIVE” YOU CAN IGNORE THE LAST TABLE (HEADED “Homogenous

Subsets”) THAT THIS PROCEDURE WILL GIVE YOU