When graph dot is used in combination with over() and nofill options, no line is drawn when one or more (but not all) variables have missing values for one of the over() categories. As an example, here is a graph created with the auto data in which the variables mpg and turn are either jointly present or missing for all values of rep78.

If turn is missing for all cases where rep78 = 4, no line is drawn for rep78 = 4.

The only solution I found is to assign some value to observations with missing values so that the marker and line are drawn; subsequently I have to remove the marker with the Graph Editor. In the example below, the value 0 is assigned to all missing values of turn where rep78 = 4.

Notice the marker at turn = 0 and rep78 = 4. This marker can now be removed with the Graph Editor or alternatively with the undocumented command gr_edit.

Is there a solution to this problem that does not involve the Graph Editor?
Code:
sysuse auto, clear replace mpg = . if rep78==2 replace turn = . if rep78==2 graph dot mpg turn, over(rep78) nofill
If turn is missing for all cases where rep78 = 4, no line is drawn for rep78 = 4.
Code:
replace turn = . if rep78==4 graph dot mpg turn, over(rep78) nofill
The only solution I found is to assign some value to observations with missing values so that the marker and line are drawn; subsequently I have to remove the marker with the Graph Editor. In the example below, the value 0 is assigned to all missing values of turn where rep78 = 4.
Code:
replace turn = 0 if rep78==4 graph dot mpg turn, over(rep78) nofill
Notice the marker at turn = 0 and rep78 = 4. This marker can now be removed with the Graph Editor or alternatively with the undocumented command gr_edit.
Code:
gr_edit .plotregion1.points[3].Delete
Is there a solution to this problem that does not involve the Graph Editor?
Comment