[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
GLM and interactions
From: |
John Darrington |
Subject: |
GLM and interactions |
Date: |
Thu, 7 Jul 2011 14:50:07 +0000 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
I'm looking at introducing interactions into the GLM command.
Following the example at
http://ssnds.uwo.ca/statsexamples/spssanova/fdequalresults.html
The given results (which I assume to be correct) on a 2 factor analysis, with
interactions are
source Type III Sum of Squares df Mean Square F Sig.
Corrected Model 210.000 5 42.000 4.755 .013
Intercept 882.000 1 882.000 99.849 .000
CATEGORY 18.000 1 18.000 2.038 .1791
DRUG 48.000 2 24.000 2.717 .1062
CATEGORY * DRUG 144.000 2 72.000 8.151 .0063
Error 106.000 12 8.833
Total 1198.000 18
Corrected Total 316.000 17
Now using PSPP's current GLM implementation, without considering the
interaction term,
we get
glm diffrate by category drug
/intercept=include
/design = category drug
.
#===============#=======================#==#===========#=====#====#
# Source #Type III Sum of Squares|df|Mean Square| F |Sig.#
#===============#=======================#==#===========#=====#====#
#Corrected Model# 66.00| 3| 22.00| 1.23| .34#
#Intercept # 882.00| 1| 882.00|49.39| .00#
#category # 18.00| 1| 18.00| 1.01| .33#
#drug # 48.00| 2| 24.00| 1.34| .29#
#Error # 250.00|14| 17.86| | #
#Total # 1198.00|18| | | #
#Corrected Total# 316.00|17| | | #
#===============#=======================#==#===========#=====#====#
Which looks plausible. We can see that when interactions are ignored,
the ssq gets bundled in with the error term.
Now, I thought that for purposes of the current investigation, I could
"fake" an interaction term as follows:
compute interact = drug * 10 + category.
glm diffrate by category drug interact
/intercept=include
/design = category drug interact
.
My reasoning is that since all values of "category" are less than 10,
then "interact" will have unique values for each combination of "category"
and "drug". Obviously we'll need a more reliable way of generating
interaction terms, but this should suffice for the current purposes.
Doing this, I get:
#===============#=======================#==#===========#=====#====#
# Source #Type III Sum of Squares|df|Mean Square| F |Sig.#
#===============#=======================#==#===========#=====#====#
#Corrected Model# 210.00| 8| 26.25| 2.23| .13#
#Intercept # 882.00| 1| 882.00|74.89| .00#
#category # .00| 1| .00| .00| NaN#
#drug # .00| 2| .00| .00|1.00#
#interact # 144.00| 5| 28.80| 2.45| .12#
#Error # 106.00| 9| 11.78| | #
#Total # 1198.00|18| | | #
#Corrected Total# 316.00|17| | | #
#===============#=======================#==#===========#=====#====#
which, as you can see gives the correct "interact" and Error values.
It's a bit dissapointing that the uninteracted "drug" and "category"
ssq are now zero.
So this means that to get all the sums of squares we will have to run
the get_ssq function twice - once without interactions, and once with.
And in general, for a NxN design where all the interactions are desired,
then it'll be necessary to run the function N times.
Is this a correct appraisal or am I looking at it too simplisticly?
J'
--
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.
signature.asc
Description: Digital signature
- GLM and interactions,
John Darrington <=