2
$\begingroup$

If I need to go over the actual data which I have, I have employee data of our company.

Employees are divided into two groups, binary(1,0). Some of them are 1 and the rest are in 0 class. The data set includes a lot of basic data for each employee, such as age, gender, the school they graduated from, time spent in the company or position. I also want to learn and see the common features of those who are in this 1 class, for example, age range, gender, universities, etc.

I know this looks like a classification problem, but isn't it possible to find these similarities without using any machine learning algorithms?

Do you think it is sufficient to perform frequency analysis and chi-square test, or is there any other analysis method or statistical test you can recommend?

$\endgroup$
1
  • $\begingroup$ It sounds like you can just look at histograms and bar charts for your two groups. Plot a bar chart comparing the ages of groups 0 and 1; plot a bar chart comparing the genders;... $\endgroup$
    – Dave
    Commented Dec 21, 2020 at 14:29

2 Answers 2

0
$\begingroup$

This is really more of a comment than a full response. You could try cross-classifying combinations of the 0,1 features. Next, ranking the frequencies of employees falling into a given bucket would give insight into any redundancy in the groupings. Since it isn't possible to illustrate what I mean by this suggestion within the context of a comment, as noted, it's been expanded into a response.

enter image description here

While this table shows univariate data, it is possible to convert it into a two-way table upon which odds ratio or chi-square tests, e.g., of independence, can be applied.

enter image description here

Conversion of more such binary features into three- and higher way tables would be an easy extension, permitting even more complex tests of significance.

$\endgroup$
0
$\begingroup$

I think the other user provided a great response since you were interested in specific features of those in 1 class, etc.

But since you asked about "similarity", maybe this is of interest too. "gower" distance is a distance metric for mixed types, meaning both continuous and categorical. You can calculate gower distance using the cluster package. Below is an example with mtcars

data(mtcars)

library(cluster)

mtcars$cyl <- as.factor(mtcars$cyl)
mtcars$vs <- as.factor(mtcars$vs)
mtcars$am <- as.factor(mtcars$am)
mtcars$gear <- as.factor(mtcars$gear)
mtcars$carb <- as.factor(mtcars$carb)

output <- daisy(mtcars, metric = "gower")
output <- as.matrix(output)

If you would like to convert the distance output to "similarities" instead, you can do the following 1 / (1+distanceMatrix):

outputS <- 1/(1+output)

As you can see you now have a matrix for how "different" each car is based on the distances/similarities among features.

enter image description here

And the similarities matrix is here:

enter image description here

I'd note that this approach doesn't necessarily tell you which features are common to each class but rather how similar each class is to each other based on the features in the dataset.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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