Data Matters with SPSS®
Activity 8.2
Redo the last project, replacing the observations with the numeric expression.
In the last project, the numeric expression for gathering the observations was =rv.normal(0,7) . To see what other functions are available, you can click on Transform, Compute and scroll through the list of functions. The random number functions all start with rv..
If you want to have the same mean but different variances, you will have to edit the Syntax. Here is the Syntax program from Section 8.1 edited to use two difference variances.
INPUT PROGRAM.
COMMENT Edit the next line to change the number of samples.
LOOP #Sample = 1 TO 4000.
COMMENT Edit the next line to set the number in each group.
LOOP #Case = 1 to 2.
COMPUTE sample = #Sample.
END CASE.
END LOOP.
END LOOP.
END FILE.
END INPUT PROGRAM.
EXECUTE.
COMMENT Notice that no measures have been added yet.
COMMENT First set all of the measures as before.
COMPUTE measure = RV.NORMAL(0,7).
EXECUTE.
COMMENT Now replace measures in even-numbered samples.
IF (TRUNC(sample/2) = sample/2) measure = RV.NORMAL(0,77).
EXECUTE.
AGGREGATE
/OUTFILE=*
/BREAK=sample
/mean = MEAN(measure) /sd = SD(measure).
COMMENT Change the 1 in the next line to one less than the number in each group.
COMPUTE ss = (sd**2)*1.
COMMENT Change the 2 in the next line to the number of groups.
COMPUTE sample = TRUNC(($CASENUM-1)/2).
EXECUTE.
AGGREGATE
/OUTFILE=*
/BREAK=sample
/sdMeans = SD(mean) /ssWithin = SUM(ss). COMMENT Set the 2 on the next line to the degrees of freedom from within.
COMPUTE varwithn = sswithin/2.
COMMENT Set the final 2 on the next line to the number in each group.
COMPUTE varBetwn = (sdMeans**2)*2.
EXECUTE.
COMPUTE F = varBetwn/varwithn.
EXECUTE.
|
There is a new kind of line in this Syntax: IF (TRUNC(sample/2) = sample/2) measure = RV.NORMAL(0,77).
This is a conditional compute. It is as if you clicked on Transform, Compute, If to limit the transformation only to particular rows. The rows are defined by what is in the parentheses on the left, immediately following the IF: TRUNC(sample/2) = sample/2 . TRUNC strips decimals. So if sample is 8, the left side is 4 and the right side is 4, and the transformation happens to that row. But if sample is 7, then the left side is 3 and the right side is 3.5, so the transformation does not happen to that row.
Try to Find Something That Misleads Even More
Can you beat my populations that led the ANOVA to reject the null hypothesis 49% of the time even though the means of both populations were the same?
Can you find distributions with equal means for which the ANOVA would reject the null hypothesis 50% of the time?
| ©2008 Key College Publishing. All rights reserved. |
|