Skip to content
Prev 1932 / 398506 Next

Design matrix labels

On Mon, 25 Jan 1999, John Logsdon wrote:

            
You can still use model.frame() and model.matrix() to create design
matrices from formulas.

	mf<-model.frame(~A+B)
	mmat<-model.matrix(~A+B,mf)

If your factors A and B are in a data frame you can use the data= argument
to model.frame().

This is what glm() and lm() do internally.

Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._