I have data that looks similar to the below example. I have time series data separated by batch. I would like the predict the "result" for each batch based on the other a number of variables, in the simple example below pH and glucose. If I pivot wider with the independent variables to get a value per predictor per day I get a ridiculously wide dataset with not very many batches. Therefore I was wondering if I can treat the data as time series to predict my target "result".
batch_data <- tribble(
~batch, ~day, ~ph, ~glucose, ~result,
"A", 1, 6, 2, NA,
"A", 2, 7, 1, NA,
"A", 3, 8, 1, 5,
"B", 1, 5, 4, NA,
"B", 2, 5, 3, NA,
"B", 3, 7, 2, 2,
"C", 1, 4, 7, NA,
"C", 2, 6, 5, NA,
"C", 3, 8, 4, 8
)