R-alpha: batch mode and interactions

Ross Ihaka (ihaka@stat.auckland.ac.nz)
Wed, 5 Jun 1996 11:16:53 +1200


Date: Wed, 5 Jun 1996 11:16:53 +1200
From: Ross Ihaka <ihaka@stat.auckland.ac.nz>
Message-Id: <199606042316.LAA03075@stat.auckland.ac.nz>
To: r-testers@stat.math.ethz.ch
Subject: R-alpha: batch mode and interactions
In-Reply-To: <9606040738.AA30046@alpha.luc.ac.be>

Jim Lindsey writes:
 > (1) As a follow-up to my problem with interactions in W&R notation, try the
 > following models and look at the design matrix created. The results are
 > surprising.
 > y <- rpois(9,2)  # this can be anything
 > x1 <- gl(3,1,9)
 > x2 <- gl(3,3,9)
 > int <- as.integer(w1)*as.integer(x2)
 > Look at the last column of the design matrices for  y~x1+x2+int and
 > 	y~x1+x2+as.integer(x1):as.integer(x2)

The problem is the lack of a type check for integer vs real
representations.  I will fix this.
	
I am currently giving the modeling code a going over.  I hope that
this will fix many/some of the problems.  In particular given factors "a"
and "b" with levels "A", "B" and "H", "M", "L", the corresponding
coefficients (with treatment contrasts) will be

	aA aB bH bM bL aA.bH aB.bH aA.bM aB.bM aA.bL aB.bL

with the coefficients aA, bH and interactions containing these strings
dropped to ensure a full-rank design matrix.  This modulo the "."
seems to be what S does.

	Ross
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-