# How to detect patterns in salary distribution if we are suspecting malicious distribution based on employee's region?

We are having suspects in salary distribution in our organisation due to employee's region. The data we have is as the following:

Name
Region
Work Position (4 main positions)
Salary
Gender


What technique should we use in Machine learning to check and detect malicious salary distribution? By using clustering?

## 1 Answer

A simple initial approach would be to separate it by position and check for each:

Use linear regression: $$\hat{salary} = \sum_i \alpha_i * \hat{region}_i + \sum_k \beta_k * \mathbf{1}[\hat{gender}=k]$$ and now you have an intuitive measure by looking at $$\alpha$$'s and $$\beta$$'s.

2 issues that may arise with this method:

• This assumes though that a linear model is a good fit, which it very well might not be
• The amount of data points may be small and this will give you point estimates without any sense of confidence.

2 possible respective solutions:

• Use a stronger model with less intuitive parameters (like a neural network) and then use common visualization techniques to determine weight of each input (this could be as simple as changing them and looking at the outcome or something more complex that utilizes the gradient), but even more complex models can still suffer from the second problem, which is why id reccommend option 2
• Use a Bayesian model, you can make something hierarchical something as simple as doing the above linear regression with a non informative prior and eventually you'd be able to build confidence intervals and get a better sense of the associations (note if youre looking for what to write this in, I recommend JAGS for its ease of use)
• Can't I do it with clustering according to each position ? And how can I do it based on neural network. There is no dependent variable in here. – alim1990 Dec 13 '19 at 19:37
• @alim1990 the clustering would be the linear combination, youd find the same result as linear regression, just in a less intuitive manner. Andd build your NN and use either the gradient to see how much it shifts or just manually grid search to get the manifold (small enough parameter space that it should be fine) – mshlis Dec 13 '19 at 19:42
• But there isn't any dependent feature to work with if I did a NN. Can you provide a sample example? – alim1990 Dec 14 '19 at 10:22
• Or at least for the Bayesian option. How to do it. – alim1990 Dec 14 '19 at 10:22
• Well I read about bayesian network. I think this is what I need. But can you help on how to relate nodes together ? – alim1990 Dec 15 '19 at 5:20