Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • QQ Plot Difficulties

    Hello , I need to compare two series of data (with sufficiently large number of observations) in range [0, 1] to the uniform distribution on [0, 1]. I want to plot the Q-Q plot with empirical CDF being the on the y-axis and the CDF of the uniform distribution on the x-axis. I also want to plot the 45 degree line, make a scatter plot of the data, make both x and y axis into log_10 scale, and put the two series on the same plot being labelled. Any help or sample code would be appreciated!!

  • #2
    Log scale isn’t compatible with showing zero, so your desiderata appear contradictory.

    Comment


    • #3
      #2 aside, the rest of what I think you want is available using qplot from the Stata Jourmal.

      Code:
      clear
      set obs 100
      set seed 2803
      gen y1 = runiform()^2
      gen y2 = sqrt(runiform())
      qplot y1 y2 , aspect(1) addplot(function reference=x)
      Click image for larger version

Name:	qqplot.png
Views:	1
Size:	35.4 KB
ID:	1516485




      At the time of writing

      Code:
      net sj 16-3 gr42_7
      gives a clickable link for installing the latest public version of qplot, but a further version is in press.

      NOTE: I have given a quantile-quantile plot, but neither axis shows an empirical cumulative distribution function. The of a quantile-quantile plot is to show ordered values. The scales lie in [0, 1] here because the variables do.
      Last edited by Nick Cox; 16 Sep 2019, 04:06.

      Comment

      Working...
      X