Density map-reflects the truth

Source: Internet
Author: User
Tags ggplot

Today's challenge is the density map:

The appearance of the myriad, we always need a graph can be a glance to show the characteristics of the data. Data distribution maps are undoubtedly very reflective of data characteristics (user symptoms). It works better with median and 9-bit.

For example, because of the secrecy, I hide what each line represents, and what the data output is. From the lines alone, you can see how many people in each channel are accustomed to buying things before, and presumably distributed. It can be seen that these three lines in fact the difference is not small, the pink channel slightly inclined to the user to place a higher amount of money, the blue channel is inclined to the user to lower the amount of the order.

Specific steps for R language processing

1. Use the which function to adjust the channel data, for example heki=hekihi[which (Hekihi$source = = * * * * * * *),]

2. Directly with the Ggplot can be plotted, the scale chart

Ggplot (3fsje,aes (X=amount)) +geom_line (stat= "Density",lwd=1.0,color= "blue") +
Xlab ("Per order Amount") +ylab ("scale") +labs (title= "Each channel contribution amount density map") +
Geom_line (Data=12fsje,aes (x=amount), stat= "Density", lwd=1.0,color= "green") +
Geom_line (Data=45fsje,aes (x=amount), stat= "Density", lwd=1.0,color= "Pink")

In fact, in turn think, this amount of each order, we use Excel, Guest unit Price = Order Amount/order number is not more convenient. In fact, this year I all report I am Excel simple one except the thing.

The price of each channel is very large, but the same density map reflects the fact that the difference is not big. The reason is that one channel has a wholesale order, the amount of an order is too large, if the simple definition of customer unit price can cover up the problem, but if the density map will not. Therefore, the density map can be more accurate and true to reflect the truth.

3.

Density map-reflects the truth

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.