I have a dataset related to work-safety that covers over 100,000 worksites over a course of 15 years. I would like to experiment with machine learning models to predict the number of injuries that will occur the next year. The objective is to create a tool that takes as input an identifier for the site and returns a prediction for the number of injuries in the upcoming year. My dataset contains indicator variables, continuous variables and categorical variables. Can you suggest models that would best leverage this data. The correlation coefficient between the average number of injuries by site and the number that occurred in the previous year on record is 0.70. How can I have my model make use of this information?

Indicator variables include whether specific types of safety gear and protocols are required, if the site is remote, the presence of a health and safety committee, the presence of hazardous substances. Categorical variables include the NAICS code, geographical region, the severity rating of the site (low, medium, high). The continuous variables include the total number of injuries, explosions, the number of assignments/inspectors that visited the site in previous year, the number of health and safety violations, the number of people employed at the site, the number of training sessions and corrective assignments charged to the site. The data is highly variable. The levels of risk vary with the line of work. Some sites require no safety material, have no violations and report no injuries. Other sites report hundreds of injuries. Given this, I would like to be able to use this data to predict the number of injuries that will occur the upcoming year.

  • $\begingroup$ Can you say something more of the data, what variables do you have, how many? How do you measure exposure, like total number of hours worked at the workplace, per year? Are the levels of risk at the workplaces similar, or do it vary much? Do you have some variables measuring relative risk? How do you measure work-safety? Number of injuries/year, number of lost work-hours? ... $\endgroup$ – kjetil b halvorsen May 30 '17 at 16:13

You have a count data problem, so I would start out with Poisson regression. That could change, as a result of preliminary analysis, with some other count-data model, like maybe negative binomial regression. The risk exposure of the sites will vary, first as a function of the size of site, measured by number of employees. So, number of employees could be used as an offset (with a log link function, use offset(log(NrEmployees)) in R). For more about use of offset, see Goodness of fit and which model to choose linear regression or Poisson. Then you use your other predictor variables in the linear predictor, categorical variables coded with dummys. For the continuous predictor variables, you could check for nonlinearities by including them with splines. Maybe interactions?

You say there is high (0.7) correlation between number of injuries and number of injuries previous year. I would not include this in a first model, maybe much of this marginal correlation is taken care of by covariables. But after the first model is fitted, you could look if there are autocorrelations in the residuals, by computing from the residuals the average autocorrelation function. If there is autocorrelation in the residuals, maybe include number of injuries previous year as a lag variable.

Then you have to look at the level of resudual variability, maybe there is overdispersion? Maybe, if that is the case, a negative binomial regression could be better. And, look at the plot of residuals for individual sites. The mean of residuals for individual sites should be approximately zero, if not, there is some indication of a site specific effect, which could be modelled via a random effects model. As a first check, I would look at the histogram of mean of residuals for each site.

You say you have 100000 sites, so maybe before starting exploring the data you should set aside an evaluation sample, which you do not use for model fitting?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.