I am supposed to predict the concentration values (conc) for control and treat group in the column in the data frame, ref values should stay the same.

labels <- c(rep(1,5), rep(2,10), rep(3,10))
levels <- c("ref", "treat", "control")
x <- as.factor(labels)
a <- levels[x]
values <- runif(25,min=0,max=25)
my.data <- data.frame(labels = a, OD=values)
my.data <- my.data[1:5,2]
my.data <- replace(values,1:5,runif(1, min=0, max=25) / 10 ^ (0:4))
new_data <- data.frame(labels=a, OD = my.data)
new_data$conc <- c(runif(25,min=0,max=25))
new_data$conc <- replace(new_data$conc,1:5,runif(1, min=0, max=25) / 10 ^ (0:4))
treat <- new_data$OD[6:15]
control <- new_data$OD[16:25]

0 Answers