官术网_书友最值得收藏!

Histogram

A histogram is a visualization consisting of rectangles whose area is proportional to the frequency of a variable and whose width is equal to the class interval.

The height of the bar in a histogram represents the number of observations in each group. In the following example, we are counting the number of observations for each type of job and marital status. y is a binary variable checking whether the client subscribed a term deposit or not (yes, no) as a response to the campaign call.

It looks like blue-collar individuals are responding to the campaign calls the least, and individuals in management jobs are subscribing to the term deposit the most:

ggplot(data = df_bank_detail) +

geom_bar(mapping = aes(x=job, fill = y)) +

theme(axis.text.x = element_text(angle=90, vjust=.8, hjust=0.8))

Figure 1.11: Histogram of count and job

主站蜘蛛池模板: 奉节县| 通许县| 彝良县| 麻江县| 布尔津县| 辽阳市| 建平县| 霸州市| 巴楚县| 红原县| 河东区| 陕西省| 琼海市| 江阴市| 大城县| 崇阳县| 额尔古纳市| 临江市| 石家庄市| 驻马店市| 扎囊县| 五常市| 临沧市| 保亭| 广宁县| 鞍山市| 确山县| 武隆县| 思茅市| 新营市| 江都市| 伊川县| 渑池县| 大同市| 克拉玛依市| 高台县| 龙胜| 泊头市| 阳泉市| 二手房| 邢台县|