Skip to content

glim in R?

1 message · Rolf Turner

#
Tim Liao wrote:

            
I doubt that you will get any joy in locating a glim() function for
R.  No-one would write one; that would be wheel-re-invention given the
existence of glm().

The glim() function is antiquated and is or should be deprecated.
The technology has moved beyond that.  What you really should do is
re-write your code to call glm().

If it is ***really*** necessary to pass the design matrix, you should
be able to

	o convert that matrix to a data frame, say ``ddd''
	o call glm(formula,data=ddd)
	o the formula would presumably be simply something
	  like ``y ~ .'' since the predictors would simply
	  be all of the individual columns of your data frame.

I can't see this as being particularly difficult recoding.  Or if you
insist, you could do just create your glim() function as:

	glim <- function(y,X,...) {
		X <- as.data.frame(X)
		glm(y~.,data=X,...)
	}

(I can't really remember the glim syntax, but ``glim(y,X,...)'' is
a reasonable facsimile.)

If your design matrix has a constant column you would want to strip
it out before passing the matrix to you glim() function.

				cheers,

					Rolf Turner
					rolf at math.unb.ca