Skip to content
Prev 166120 / 398502 Next

Two Noobie questions

1. I have a list of lm (linear model) objects. Is it possible to select,
through subscripts, a particular element (say, the intercept) from all the
models? I've tried something like this:

List[[1:length(list)]][1]
All members of the list are similar. My goal is to have a list of the
intercepts and lists of other estimated parameters. Is it better to convert
to a matrix? How to do this?

2. Connected to this, how do I convert from a list back to a vector? This
problem arose from using "split" to split a vector by a factor, then
selecting a subset of this (ie. length>10), leaving me with subset list of
my original. Unsplit(newList, factor) doesn't work, presumably due to my
removal of some values. Thoughts?

Thanks!
-Allen