[R] question on using "gl1ce" from "lasso2" package

Berwin A Turlach berwin at maths.uwa.edu.au
Thu Jul 26 07:20:54 CEST 2007


G'day Li,

On Wed, 25 Jul 2007 00:50:43 -0400
"Li Li" <lilycai2007 at gmail.com> wrote:

> I tried several settings by using the "family=gaussian"
> in "gl1ce", but none of them works. [...]
> > gl1ce(Petal.Width~Sepal.Length+Sepal.Width+Petal.Length,
> > data=iris,family=gaussian())
> Error in eval(expr, envir, enclos) : object "etastart" not found
> 
> Does anyone have experience with this function?
> Any help will be appreciated,

Actually,

> gl1ce(Petal.Width~Sepal.Length+Sepal.Width+Petal.Length, data=iris,
+ family=gaussian)

should work.  No need to say `family=gaussian()'.

However, omitting the brackets leads to an even more obscure error
message and using traceback() makes me believe that the function
`family()' must have been changed since this code was ported from
S-Plus to R.  

The version with brackets does not seem to work since the function that
tries to determine initial values for the iterative process of
fitting a GLM tries to access an object called `etastart', which exist
in the list of formal parameters of glm() but is not a formal parameter
of gl1ce(). I am not sure whether this problem always existed or is also
new due to changes in glm() and accompanying functions.  (Time to
re-work the whole lasso2 package, I guess.)

A way to solve your problem is to issue the following commands:

> etastart <- NULL
> gl1ce(Petal.Width~Sepal.Length+Sepal.Width+Petal.Length, data=iris,
+ family=gaussian())

However, since you are using the gaussian family, why not use l1ce()
directly?  The following command leads to the same output:

> l1ce(Petal.Width~Sepal.Length+Sepal.Width+Petal.Length, data=iris,
+ absolute=TRUE)

Hope this helps.

Cheers,

	Berwin

=========================== Full address =============================
Berwin A Turlach                            Tel.: +65 6515 4416 (secr)
Dept of Statistics and Applied Probability        +65 6515 6650 (self)
Faculty of Science                          FAX : +65 6872 3919       
National University of Singapore
6 Science Drive 2, Blk S16, Level 7          e-mail: statba at nus.edu.sg
Singapore 117546                    http://www.stat.nus.edu.sg/~statba



More information about the R-help mailing list