[R] summary of a list
lauramorgana at bluewin.ch
lauramorgana at bluewin.ch
Fri Feb 13 09:06:37 CET 2009
Hello Dieter and everyone,
Thank you for your advice... but I didn't manage to solve my problem... :-(
I actually like the fact that R tells me which ones of my regressions didn't achieve convergence and gives me a
warning saying that there was a false or singular convergence...
the problem is that out of 35 regressions I do with my loop, only 5 don't achieve convergence and I would like to be
able to get the summaries(or sigma, or coef, ...)
of the 30 regressions that did achieve convergence... (I know from the start that some regression functions will work
for some variable and not necessarily for others)
At the moment I check which ones reach convergence by doing
print(resultList)
and then I extract the summary by doing the following loop:
summaryList<-list()
for (i in c(1:8, 11:14, 16:24, 26:34))
{
summaryList[[i]]<-summary(resultList[[i]])
}
But this is quite tedious, since I will have to repeat it for other rivers and also in the next years...
Is there a way to tell R to show me the summary of all the results anyway? Cause right now if I do:
summaryList<-list()
for (i in length(resultList))
{
summaryList[[i]]<-summary(resultList[[i]])
}
R only shows me the first 8 summaries and then stops because the ninth didn't reach convergence...
Any suggestion?
P.S. I tried to use nls2 but I have the same problems...
lauramorgana <at> bluewin.ch <lauramorgana <at> bluewin.ch> writes:
>
> Hello,
> I'm using the following for loop to find regression curves using a list of
functions (formList), a list of
.. long non-reproducible code removed
> And I got the following error message:
> Error in chol2inv(object$m$Rmat()) : l'elemento (3, 3) è zero, quindi
l'inversa non può essere calcolata
> Which translated should be: Error in chol2inv(object$m$Rmat()): the element
(3, 3) is zero (NULL?),
> that's why the
> inverse (inverse function?) can not be computed
nls is rather nasty or nice in telling you when the result should not
be trusted. Other software gives nonsense result without blinking.
In package nlme, there is a function nlsList which does directly what you
want, but there is little help besides revising the model for the cases
without convergence.
Also try check Gabor Grothendieks package "nls2" which could help you
finding better start values.
Dieter
______________________________________________
R-help at r-project.org 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.
More information about the R-help
mailing list