R - 如何将多个 MLE 输出打印为数据帧

R - how to print multiple MLE output as dataframe

我是 R 的新手,我正在为不同的样本大小从多个 MLE 运行 获取 table 输出值。 这是我的代码:

library(fitdistrplus)
library(actuar)

set.seed(1234) 
#Generating Sample1 and saved in a list
n <- c(25, 50, 100, 250, 500)
mean <- 10
sd <- 1
#generate a list of list of 25 zeros, 50 zeros...
Sample1.list <- list(n25=rep(0, 25), n50=rep(0, 50), n100=rep(0, 100), n250=rep(0, 250), n500=rep(0, 500))
MLE_Sample1 <- list(rep(c(0, 0), times=length(n)))

for (i in seq_along(n)) {
  Sample1 <- rlnorm(n[i], meanlog=mean, sdlog=sd)
  Sample1.list[[i]] <- Sample1
  MLE.lnorm <- mledist(Sample1, "lnorm")
  estimate <- MLE.lnorm$estimate
  MLE_Sample1[[i]] <- estimate
}

现在,列表 'MLE_Sample1 包含所有 MLE 输出(即两个对数正态参数估计值) 对于每个样本,我想将它们呈现在一个独特的 object 作为数据框或 table,矢量名称为 header。不幸的是,我找不到办法做到这一点。我试图在这里和 R-guides 上查看不同的来源,但我没有找到任何东西,这很奇怪,因为对我来说它似乎是 R 中的一个基本操作.. 有谁知道如何处理? 一如既往,我们将不胜感激任何帮助。 谢谢

如何使用 data.frames 的列表,然后 rbindlist 它们(一个 data.table 函数)

library(fitdistrplus)
library(actuar)
library(data.table)

set.seed(1234) 
#Generating Sample1 and saved in a list
n <- c(25, 50, 100, 250, 500)
mean <- 10
sd <- 1
#generate a list of list of 25 zeros, 50 zeros...
Sample1.list <- list(n25=rep(0, 25), n50=rep(0, 50), n100=rep(0, 100), n250=rep(0, 250), n500=rep(0, 500))
MLE_Sample1 <- list(rep(c(0, 0), times=length(n)))


for (i in seq_along(n)) {
  Sample1 <- rlnorm(n[i], meanlog=mean, sdlog=sd)
  Sample1.list[[i]] <- Sample1
  MLE.lnorm <- mledist(Sample1, "lnorm")
  estimate <- MLE.lnorm$estimate
  MLE_Sample1[[i]] <- as.data.frame(t(estimate))
}
rbindlist(MLE_Sample1)

     meanlog     sdlog
1:  9.758218 0.9048491
2:  9.773453 1.0790497
3: 10.052040 0.8846443
4: 10.035170 1.0340745
5:  9.954018 0.9791639