Data Analysis

Salary Comparison by Education Level: Which Degree Earns More? / 최종 학력에 따른 연봉 분석

재르미온느 2024. 3. 14. 15:26

Currently, I'm concerned about my career path, particularly the decision to pursue graduate studies. Therefore, when I obtained the dataset from DACON, I was particularly curious about salary trends across different education levels.

ref: https://dacon.io/competitions/official/236230/data

 

소득 예측 AI 해커톤 - DACON

분석시각화 대회 코드 공유 게시물은 내용 확인 후 좋아요(투표) 가능합니다.

dacon.io

최근 대학원 진학에 대한 고민이 많이 생겨서, DACON에서 받은 소득 dataset에서 최종 학력을 기준으로 분석해보기로 했다.

 

 

import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

train=pd.read_csv("C:/data/open/open/train.csv")
high_sal=train[train['Gains']>15000]

f,ax=plt.subplots(1, 1, figsize=(20,5))
sns.countplot(y='Education_Status', data=high_sal, order = high_sal['Education_Status'].value_counts().index)
plt.show()

 

I created a new DataFrame containing over 15,000 dollars. I then counted the number of records for each education status and visualized the results using a countplot from the Seaborn library.

연봉이 15,000달러 이상인 사람들만 포함하도록 데이터프레임을 다시 만들었고, 그 데이터프레임 내에서 학력별로 counting 및 visualization했다.

 

Figure_1

 

 

Figure 1 reveals that 'Bachelors degree' is the most prevalent education level among high-income individuals. However, I was interested in determining the percentage of high-income individuals within each education group.

15,000달러 이상을 버는 그룹 내에서는 학사학위 소지자가 가장 많으나, 각 그룹별 비율을 확인해보는 것이 좀 더 정확하겠다는 판단이 들어 추가적으로 분석하였다.

 

aca=dict(high_sal['Education_Status'].value_counts())
tr_aca=dict(train['Education_Status'].value_counts())

df_1=pd.DataFrame({"counts":aca.values()},index=aca.keys())
df_2=pd.DataFrame({"total":tr_aca.values()},index=tr_aca.keys())
data=pd.concat([df_1,df_2],axis=1,join="inner")
data['Percentage(%)']=data['counts']/data['total']*100
data['Education_Status']=data.index
for_graph=data[['Percentage(%)','Education_Status']].sort_values(by=['Percentage(%)'],ascending=False)

f,ax=plt.subplots(1, 1, figsize=(20,5))
sns.barplot(x=for_graph['Percentage(%)'],y=for_graph['Education_Status'],data=for_graph)
plt.show()

 

Figure_2

Interestingly, 'Doctorate degree' exhibit the highest percentage. It means that 12% of individuals with a doctorate degree earn more than $15,000 annually. This finding prompts me to further consider graduate school in my career trajectory. :)

 

흥미롭게도, 박사학위 그룹 내에서 연에 15,000달러 이상을 버는 사람들의 비율이 가장 높다. 대학원 진학을 조금 더 긍정적으로 고려해봐야겠다.