Finding Cumulative Distribution Functions and merging them I made up a data set with n=314, mean =14.27854, standard deviation =2.16547 using p <-rnorm(314,14.27854, 2.16547). Now, I want to compare theoretical  cumulative distribution with the empirical cumulative distribution by drawing both in the same graph in R. I thought that I can find the empirical cumulative distribution using ecdf(p), but I could not find a way for theoretical cumulative distribution. Moreover, I am a beginner in R, and I do not know how to show these two graphs in one graph.
Firstly, is ecdf(p) code correct?
Secondly, how can I find theoretical cumulative distribution?
Thirdly, how can I show them together in one graph in R?


Firstly, is ecdf(p) code correct?


*

*Yes, your code is correct for plotting the empirical CDF for 314 randomly generated data points from a known distribution.


Secondly, how can I find theoretical cumulative distribution?



*You know the parameters for the distribution (normal with the mean and standard deviation that you supplied), you just need to plot them.  You also know how to plot an empirical distribution already.  The empirical distribution approaches the theoretical distribution as the sample size approaches infinity.  You can get very close to the theoretical distribution within the ecdf function by using a very large sample size (say n = 20,000).


Thirdly, how can I show them together in one graph in R?



*The related answer here shows just that.  Below, I tuned the answer to your question below. ecdf1 represents your empirical function, you can change ecdf2 to approximate the theoretical distribution by using a very large sample size. 
ecdf1 <- ecdf(rnorm(314,14.27854, 2.16547))
ecdf2 <- ecdf(rnorm(20000,14.27854, 2.16547)) 
plot(ecdf1, verticals=TRUE, do.points=FALSE)
plot(ecdf2, verticals=TRUE, do.points=FALSE, add=TRUE, col='brown')

