Hi to everybody
I got a private request of the syntax to run a linearity test in
regression when you have repeated X values. As I though more people could
be interested, I'm posting it:
(Q) Can you outline how it works? (Unfortunately,
repeating values of the IV aren't very common.)
(A) They aren't, unless you plan them at the design step.
* The following example gives the reaction times to a visual stimulus
in 15 subjects that have taken a certain dose of alcohol (0/40/80 g).
DATA LIST LIST/ id alcohol rtime (3 F4.0).
BEGIN DATA
1 0 3
2 0 1
3 0 2
4 0 4
5 0 2
6 40 5
7 40 3
8 40 4
9 40 6
10 40 6
11 80 7
12 80 5
13 80 6
14 80 8
15 80 7
END DATA.
VAR LABEL rtime 'Reaction time (ms)'
/alcohol 'Alcohol dose (g)'.
* You can do a standard regression analysis, and also, this one *.
MEANS TABLES=rtime BY alcohol
/CELLS MEAN COUNT STDDEV
/STATISTICS LINEARITY .
As you'll see when you run the syntax, you get an ANOVA table where
the between-groups variation is further split into linearity (1 df)
and deviation from linearity (k-2 df). It's non-significant for these
data, showing that the relationship between alcohol dose and reation
time doesn't deviate from linearity.
I have a non-parametric version of this method, based on Kruskal-Wallis
and Cuzick test for monotonic trend, just in case you are interested.
Regards