Hi, I've a list containing parameters (intercepts & coefficients) of 12 regressions fitted> coeff[[1]] (Intercept) anno -427017.1740 217.0588 [[2]] (Intercept) anno -39625.82146 21.78025 ..... [[12]] (Intercept) anno 257605.0343 -129.7646 I want create a data frame with two columns (intercept and anno)using data in these list. Any help will be appreciated. Best Vito ====Diventare costruttori di soluzioni "The business of the statistician is to catalyze the scientific learning process." George E. P. Box Visitate il portale http://www.modugno.it/ e in particolare la sezione su Palese http://www.modugno.it/archivio/cat_palese.shtml
Try something like: as.data.frame(do.call("rbind", coeff)) HTH, Andy> From: Vito Ricci > > Hi, > > I've a list containing parameters (intercepts & > coefficients) of 12 regressions fitted > > > coeff > [[1]] > (Intercept) anno > -427017.1740 217.0588 > > [[2]] > (Intercept) anno > -39625.82146 21.78025 > > ..... > > [[12]] > (Intercept) anno > 257605.0343 -129.7646 > > I want create a data frame with two columns (intercept > and anno)using data in these list. > > Any help will be appreciated. > Best > Vito > > > > ====> Diventare costruttori di soluzioni > > "The business of the statistician is to catalyze > the scientific learning process." > George E. P. Box > > > Visitate il portale http://www.modugno.it/ > e in particolare la sezione su Palese > http://www.modugno.it/archivio/cat_palese.shtm> l > > > ______________________________________________ > > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > >
Vito Ricci <vito_ricci at yahoo.com> writes:> Hi, > > I've a list containing parameters (intercepts & > coefficients) of 12 regressions fitted > > > coeff > [[1]] > (Intercept) anno > -427017.1740 217.0588 > > [[2]] > (Intercept) anno > -39625.82146 21.78025 > > ..... > > [[12]] > (Intercept) anno > 257605.0343 -129.7646 > > I want create a data frame with two columns (intercept > and anno)using data in these list.data.frame(do.call("rbind",coeff)) Did this result from an lapply() construct? If so, consider using sapply(); then you can just do data.frame(t(coeff)) -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Vito Ricci wrote:> Hi, > > I've a list containing parameters (intercepts & > coefficients) of 12 regressions fitted > > >>coeff > > [[1]] > (Intercept) anno > -427017.1740 217.0588 > > [[2]] > (Intercept) anno > -39625.82146 21.78025 > > ..... > > [[12]] > (Intercept) anno > 257605.0343 -129.7646 > > I want create a data frame with two columns (intercept > and anno)using data in these list.coeffD <- as.data.frame(t(matrix(unlist(coeff), , 2))) names(coeffD) <- names(coeff[[1]]) Uwe Ligges> Any help will be appreciated. > Best > Vito > > > > ====> Diventare costruttori di soluzioni > > "The business of the statistician is to catalyze > the scientific learning process." > George E. P. Box > > > Visitate il portale http://www.modugno.it/ > e in particolare la sezione su Palese http://www.modugno.it/archivio/cat_palese.shtml > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html