[R] bootstrapping results in table format

Peter Wagey peter.wagley09 at gmail.com
Sat Oct 7 01:16:05 CEST 2017


Hi R users,
I was struggling to put the results into table format. Would you mind to
show using following data and code how we can put the results into table? I
further would like to have a  confidence interval for each group.


set.seed(1000)
data <- as.data.table(list(x1 = runif(200), x2 = runif(200), group =
runif(200)>0.5))
data.frame(data)
head(data)
stat <- function(x, i) {x[i, c(m1 = mean(x1))]}
A<-data[, list(list(boot(.SD, stat, R = 10))), by = group]$V1

Thanks

	[[alternative HTML version deleted]]



More information about the R-help mailing list