Dear all,
I have a data containing student's grades, and I want to plot cumulative distributions of grades for two samples of students. I use the following:
cumul grade_avg, generate(gucum)
sort gucum
cumul grade_avg if substr(opc_ed01,1,1)=="6",generate(gufirst)
twoway (line gucum grade_avg) (line gufirst grade_avg), ytitle(CDF of grade average) ylabel(, angle(horizontal)) xtitle(grade average)
Then in the graph, the first cdf (blue) fits my expectation, but the second cdf (red) looks very strange, with kinks going down. I thought cumulative distribution should always be non-decreasing?
For the first cdf, without using "sort gucum" I get similar plot like the red one (with kinks going down). Then I suppose the problem is with sort the value? So how could I combine the two graphs while sorting both gucum and gufirst (on the y-axis)?
Many thanks in advance.
I have a data containing student's grades, and I want to plot cumulative distributions of grades for two samples of students. I use the following:
cumul grade_avg, generate(gucum)
sort gucum
cumul grade_avg if substr(opc_ed01,1,1)=="6",generate(gufirst)
twoway (line gucum grade_avg) (line gufirst grade_avg), ytitle(CDF of grade average) ylabel(, angle(horizontal)) xtitle(grade average)
Then in the graph, the first cdf (blue) fits my expectation, but the second cdf (red) looks very strange, with kinks going down. I thought cumulative distribution should always be non-decreasing?
For the first cdf, without using "sort gucum" I get similar plot like the red one (with kinks going down). Then I suppose the problem is with sort the value? So how could I combine the two graphs while sorting both gucum and gufirst (on the y-axis)?
Many thanks in advance.
Comment