I have a data frame with many columns. The first column contains categories such as "System 1", "System 2", and the second column has numbers that represent the 0's and 1's. Please see below :
For example:
| SYSTEM | Q1 | Q2 |
|---|---|---|
| S1 | 0 | 1 |
| S1 | 1 | 0 |
| S2 | 1 | 1 |
| S2 | 0 | 0 |
| S2 | 1 | 1 |
I have this code in R to run Bootstrap 95% CI for mean function to obtain mean from the data (with indexing).
Here is my code :
m <- 1e4; n <- 5
set.seed(42)
df2 <- data.frame(SYSTEM=rep(c('S1', 'S2'), each=n/2), matrix(sample(0:1, m*n, replace=TRUE), m, n))
names(df2)[-1] <- paste0('Q', 1:n)
My code gives me this an error