Please, help mewith my homework. I have a dataset with information about Sales of 10 different stores. I should to predict the sales on the 2 monthes. For my model I used the column "Open" - at what day the store is open or closed; and "Promo" - if store have a promotion or not. I've built an lm model:
m.s<-lm(Sales~Open+Promo, data)
sale<-predict(m.s, newdata, ...)
This model works for 1 store, but how i can build this model for all 10 stores and predict the sales?
Personally I was thinking something like:
bn<- for(Store in 1:10 )
{m.sales7<-lm(Sales~Open+Promo, data)}
But it doesn't work/