Sunteți pe pagina 1din 4

SPSS notes, Math 151: Statistical inference (BPS5e Ch.

17)

SPSSv.19

One variable, t procedures:


One sample t test
Cola manufacturers test new recipes for loss of sweetness during storage. Trained testers rate the sweetness change
(before after). (Positive number indicates sweetness is lost.) Results for 10 tasters for a new cola recipe:

Load or type in the data: 2.0 0.4 0.7 2.0 0.4 2.2 1.3 1.2 1.1 2.3.
BPS5e p. 450, eg. 17.3. File at \\Morganstore: Users\ ssievers \Math151-Moore5e\PC-SPSS\Ch17\eg17-03.por.
Type SWEETLOS in the Variable View: Label column so your output will be labeled.
Check the Variable View: Measure column. It needs to be Scale!
Check for near normality: Dotplot (Graphs>LegacyDialogs>Scatter/Dot>SimpleDot) is OK for this few.

Analyze>CompareMeans>One-Sample T Test.
Select the variable to be tested and click it across to the right box
Set Test Value = your H0 value = 0 here ("no loss").
One-Sample Statistics
N
SWEETLOS

Std.
Deviation
1.1961

Mean
1.0200

10

(For Confidence interval around


test value, do Options, type in the
desired confidence level.)
Std. Error
Mean
.3782

One-Sample Test
Test Value = 0

p-value

SWEETLOS

t
2.697

df
9

Sig.
(2-tailed)
.0245

Mean
Difference
1.0200

Get the results, then examine the


output here-Results
for one
0 : Null hypothesis value
sample
t
95% Confidence
(Add 0 to these
Interval of the
Difference
to get a CI for
Lower
Upper
the mean
.1644
1.8756
value.)

(Example
17.3 p.
450-1)

Divide by 2 to get 1 tailed p value

To get more digits showing in a table (e.g. for sig. = .0245) Double click on the table, then click on the cell of
interest, till its highlighted (white on black). Go to Format menu, Cell Properties, Format Value and you can change
number of decimal places. Can be cranky.

Ha: >0 (positive numbers are loss in sweetness) So P-value = .0245/2 = .0123.
Confidence Interval: (do above, with test value = 0, OR, if your null hypothesis isnt 0...)
Analyze>Descriptive Stats>Explore. (Click your variable into the Dependent list.)
In the Explore dialog box, hit the
Statistics button: Find the box to change the confidence level, but leave it as 95%.
Display both Statistics and Plots, so you get a stemplot too.
Descriptives
SWEETLOS

Mean
95% Confidence
Interval for Mean
~~~~~~~
Std. Deviation

Lower Bound
Upper Bound

Statistic
1.0200
.1644

Std. Error
.37824

Note Std. Error .37824


= Std. Deviation
1.19610 divided by

1.8756
~~~~
1.19610

SPSS_notes_onesampleF11.doc 11/28/11

square root of 10
(3.162)

SPSS_notes_onesampleF11.doc 11/28/11

Matched pairs (Paired samples) pp. 453-457


Starting with data in two variables--a value for each measured on each subject or pair.
(BPS5e p.455. Example 17.4 Do Chimpanzees Collaborate?). Open the datafile from Table 17.1,
Math151-Moore5e\PC-SPSS\Ch17\ta17-01.por. The file doesnt exactly match the table--Differences arent given.

The variables are collab and nocollab. Type Collab Needed and No Collab Needed in the
Variable View: Labels column. Check the Variable View: Measure columns. They need to be Scale!
Analyze>Compare Means>Paired-Samples T-Test
Click Collab Needed across. Then click No Collab Needed across. The one that is clicked across first
will become Variable1, the other will become Variable 2, in Pair 1. The variables will be subtracted in the
direction shown, Variable 1 Variable 2, in this procedure (Collab-NoCollab) If you wanted to look at
(NoCollab-Collab) you could highlight their row and use the double arrow to reverse their places .Do OK.

(The null hypothesis in the SPSS Paired Samples procedure is always assumed to be no
difference, the population mean of the difference = 0, so it isnt stated. Confidence Level is
under Options button.)
This is a one-sided testchimps will seek a partner more when its needed (positive mean
difference). The t is very large, over 7, so the P-value is very small (I reformatted to show more digits..
P (one-sided) = .0001532=.000077. Extremely highly significant.
Paired Samples Test
Paired Differences
95% Confidence
Interval of the
Difference
Mean

Pair 1 Collab Needed


- No Collab Needed

Std.
Std. Error
Deviation
Mean

12.375

4.749

1.679

Lower

Upper

8.405

16.345

Sig.
(2-tailed)

df

7.370

0.000153

One-Sample Test
Test Value = 0

t
COMPUTE Difference=
collab - nocollab

7.370

Sig.
(2-tailed)

df
7

.000153

Mean
Difference
12.37500

95% Confidence Interval


of the Difference
Lower
8.4047

Upper
16.3453

Using the one


variable
Difference

SPSS_notes_onesampleF11.doc 11/28/11

Optional:
Create a new variable which holds the
Difference for each subject:
Use Transform >Compute variable, then type
and/or click across to get
Target Variable = Numeric Expression
Difference
collab nocollab .
Type&Label Use expression as label is good. Hit
OK to make the new variable.
Matched pairs test can now be done just using
the Difference variable and the One-sample
method. (The cola data--front page--was differences
before-to-afterthey just didnt give us the raw values.)

You can use the Difference variable to check for skewness, outliers. ( & Test against a non-0 Ho.)

SPSS_notes_onesampleF11.doc 11/28/11

S-ar putea să vă placă și