Re: [R] save lm output into vectors

2007-10-10 Thread Chuck Cleland
Henrique Dallazuanna wrote: > Hi, > > mods <- lapply(lapply(df[,which(sapply(df, is.factor))], > function(reg)lm(df$value~reg)), summary) > res <- lapply(mods, "[", c(4,10)) > > And for each model adjusted: > 1-pf(res[[2]][[2]][1], res[[2]][[2]][2], res[[2]][[2]][3]) > 1-pf(res[[1]][[2]][1], res[

Re: [R] save lm output into vectors

2007-10-10 Thread jim holtman
It really depends on what you want to do with the values. If you are computing these in a loop, then I would suggest that you store the output of 'summary' in a list and you can then extract the values later. Can you provide an idea of what you want to do with them and how you are computing them.

Re: [R] save lm output into vectors

2007-10-10 Thread Henrique Dallazuanna
Hi, mods <- lapply(lapply(df[,which(sapply(df, is.factor))], function(reg)lm(df$value~reg)), summary) res <- lapply(mods, "[", c(4,10)) And for each model adjusted: 1-pf(res[[2]][[2]][1], res[[2]][[2]][2], res[[2]][[2]][3]) 1-pf(res[[1]][[2]][1], res[[1]][[2]][2], res[[1]][[2]][3]) On 09/10/2

[R] save lm output into vectors

2007-10-10 Thread Jiong Zhang, PhD
Hi, May I ask how I can save the coefficients and the p values into a table? thanks. jiong The email message (and any attachments) is for the sole...{{dropped:11}} __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEA