A
A
Andrey Goroshko2019-10-12 20:32:03
Mathematics
Andrey Goroshko, 2019-10-12 20:32:03

How can I explain some of the code in my R plotting variant?

I draw graphs comparing two distributions: normal and binomial. Here is part of the code:

df1<-tibble(x = sort(rnorm(1e5)),
       cumulative = cumsum(abs(10-x)/sum(abs(10-x)))/2.5)
df2<-tibble(x1 = sort(rbinom(1e5,1e5, 0.001)/1e5))

There are a few things I can't figure out:
  1. What nominal parameters, besides the sorted x, do we feed into the distribution df1
  2. What kind of parameters are fed into df2 and why do we have to divide by 1e5, I didn’t find such a formula?
  3. Why numbers like 10 and 2.5 are used

I found this example on the net, and I would like to figure out why this or that graph is drawn this way. Thanks in advance for your reply

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question