Skip to content
Prev 2298 / 7420 Next

Extracting information from lm results

Just to inform:
I posted that before in R-sig-ecology but as it might be interesting also for other useRs, I post it also to the general r-user list:


Hello Alexandre,

thank you very much. I also found another way to extract summarizing information from lm results over e.g. 1000 repeated model runs:

results2 <- t(as.data.frame(results))
summary(results2)

Although some questions popped up in my analysis (procedure see below) :

1) it seems that I can't get an element with the usual
command like results2$intercept ... that doesn't work here, why?
That would be useful for plotting an element like R-squared etc.
It can be done with e.g hist(results2[,1]) but then I've to know which
column is which coefficient.

2) is there a correct way to get a "mean" p - value or any
other mean of the regression coefficients? What is the statistically proper
way to calculate summaries for regression coefficients of many model runs Or can I just use the mean from the summary? Is there any restriction when using a log transformation like: lm(log(Y)=log(X1)+X2())?

3) How can I check for normality of the residuals in my overall model?
I know how to run lillie.test(resid(lm.model)). But how to do that in my case with 1000 model runs? Perform the test for each run and get an average or pool the residuals?

4)with single lm-runs it is possible to compare the results of
two models with an anova...how can I compare the results of lets
say two models with each 1000 model runs?


Thank you very much

/johannes


-------- Original-Nachricht --------
--