ARIMA possible with multiple groups? I’m looking to build an ARIMA model in R to help me predict the number of shots a football player is going to take in a game. 
I have last season's data to analyse to determine the optimal lags for my AR and MA parameters. I have a data frame in R, with the columns for the player name, date of match and the number of shots. 
Unfortunately, I only have a maximum 38 data points for each player which isn’t enough to build a statistically confident model. I suspect I need a way to analyse the data holistically/all-at-once to help me determine the optimal lags.
I don’t, however, know how to do that or even if this is a statistically sound technique. 
At the moment I am just analysing my residuals (which have come from a linear regression with independent variables such as Home/Away and Team Possession) with code such as the following:
arima(residuals, order=c(3,0,0))

Is there a way to instruct R to perform this ARIMA analysis whilst looking at lots of mini-groups (where the groups are categorised by player name)?
Any help would be much appreciated. 
Will 
 A: If you really want the same model order to fit all the players, you could do the following. 


*

*Decide the order or integration, I suppose it is I(0). 

*Define the pool of candidate models, e.g. { ARIMA(0,0,0), ARIMA(0,0,1), ARIMA(1,0,0), ARIMA(1,0,1) }. 

*Estimate each model on each player's data (it will take two for loops nested in each other, one across models and the other across players), obtain AIC of each model. 

*See which model order gives the lowest average AIC when averaged over all players. This will be the model order you will choose. 


But I would also consider allowing for different model orders for different players. Why not try function auto.arima from "forecast" package for each player separately; auto.arima usually works quite well.
You could compare both methods (1. the same order for all players, 2. different orders for different players) by splitting your data into a pseudo "in-sample" (e.g. first 33 values for each player) and pseudo "out-of-sample" (e.g. last 5 values for each player) and see which method applied on the "in-sample" data produces better forecasts of the "out-of-sample" data.
