A description of distribution pattern of credit score of trade

Source: Internet
Author: User

I want to study the distribution pattern of the credit score of the sellers in the online transaction. But there is no real data on hand, and in the data hall found about the film and 5 score data, this can do a good simulation, much like ebay credit scoring feedback scoring method. This data is used for simulation and simulation is performed in R.

Long time useless R, about R knowledge now to gradually pick up. During the operation about R, the following problems are encountered:

1. The source data is not listed and re-named. Direct use

Names (MyData) <-C (' user_id ', ' item_id ', ' rating ', ' timestamp ') into the error, replace

Colnames (MyData) <-C (' user_id ', ' item_id ', ' rating ', ' timestamp ') succeeded.

Notice in R: Names when viewing data, dimnames; colnames,rownames; and when writing data,Rwo.names, col.names of various functions. (need to learn their differences and scope of application)

2. Drawing on the data. In order to understand the distribution patterns of a data, the commonly used graphic distributions are:

  Histogram hist ()

Stem and leaf graph stem ()--this has no way to put the default graphics is not very good, can right-click like a histogram is good.

Usually after you get the histogram, you need to add l[lines ()] a density curve [density ()] to the graph to see its distribution pattern.

  density (): Density function , plot (density (x)) to draw a density function,lines () to add a density curve .


Several functions are involved:

Dnorm is the density function of normal distribution, and pnorm is the distribution function of normal distribution.

Qqplot (), commonly used to test whether the data is a normal distribution, is a normal comparison of two samples,qqplot (x), where x is a set of samples, run error

        qqnorm () sample is compared with the expected normality of the sample. This method should be used in this experiment. But because of the data discontinuity, the drawing is also discrete.

3. About line drawing, lines (), Abline () can add lines to a drawn graphic, but:

  The function of lines () is to add lines to an existing diagram, draw a line graph, and its input is the dot vector life of x, Y. Lines (x, y), function equivalent to plot (x,y,type= "1")

The function Abline () can add a straight line to the graph, using a method that has four formats.
(1) Abline (A, B)
To draw a line that Y=A+BX
(2) Abline (h=y)
To draw a horizontal line across all points.
(3) Abline (v=x)
Represents a vertical line that draws an entire point.
(4) Abline (lm.obj)
This method is often used to draw a linear equation derived from a linear model.


4. In reviewing the above knowledge, the practice of http://blog.sina.com.cn/s/blog_8d8d6cde01017d1b.html provides examples. At last encountered error in Plot.new (): Figure margins too large errors. Use the Http://blog.sina.com.cn/s/blog_6a1fa6e20102uzjy.html method to solve, that is, when using R in Rstudio, to pull the large graphic display window, otherwise the graphics can not be displayed and error.

Continue the experiment, need to add!

A description of distribution pattern of credit score of trade

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.