I'm running a regression to try to explain how long people spend in a hospital's A&E (ER) department. The data contains the data on several million individual patients who were in hospital over two years. The basic structure is as follows:

Code:
 reg MinsinAE i.sex#i.agegroup i.diagnosis i.had_CT i.hadMRI i.hadCT i.hadbloods hospitalbedcapacity
Over the two year period the average time in A&E has increased so we want to see how each of the variables might explain that. To do this I need to combine the coefficients from the regression with the change in the mean of the variables to see how much of the change in the predicted time in A&E could be attributed to each variable.

I've tried using margins but I'm not sure if the results I obtain are telling me what I think. Can anyone help please?

My margins command is:

Code:
margins  , over(years) at((means) _all)
I also wondered if it were possible to get the overall marginal effect of groups of variables (I have several hundred in my model). For example, the impact of all the diagnostic tests.

Many thanks
Rob