I'd appreciate some tips, I'm making a simple mistake trying to
extract elements from a list of fit objects.
The following command works, coef( cph.list[[1]] ) ,.... coef(
cph.list[[3]] ) and so forth. These extract regression coefficients
from the appropriate list element.
When I try to run this inside a for loop, or an lapply
(lapply(cph.list,coef)) I get this error message
> for (ii in (1:22)){
+ cat(ii,fill=T)
+ print(coef( cph.list[[ii]] ))
+
+ }
1
Error in object$coefficients : $ operator is invalid for atomic vectors
Suggestions appreciated.
Thanks in advance.
Chris Barker, Ph.D.
Statistical Consultant
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.