Announcement

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

  • Desingplot without showing the missing values

    Suppose i have the following data in which the variables have some missing values. I want to show the "counts" of every variable when they are 1 and 2, without counting the missing values. If i use designplot i got the same counts for every variable when that's not what indicate in the data. I change the missing values for 0 and got the result that i want, but i don't want to show the missing values in the graph. Anyone can help me to not show the missing values/zero's in the graph?

    Code:
    Code:
    input float (var1 var2 var3)
    1 1 .
    2 2 2
    2 . .
    1 . .
    1 1 .
    2 2 2
    2 2 2
    1 1 .
    2 . 2
    . . .
    2 2 .
    . . .
    . 1 .
    2 2 2
    2 2 2
    1 . 1
    2 2 2
    1 1 1
    1 . .
    2 2 .
    2 2 2
    1 1 .
    2 2 2
    1 1 .
    2 2 2
    1 1 1
    . 2 2
    . . .
    . . .
    . 2 .
    1 1 1
    2 2 .
    1 1 .
    2 2 2
    . 2 .
    . 1 .
    2 2 .
    . . 1
    end
    
    label define mylabel 1 "T=0" 2 "T=5"
    label val var* mylabel
        
    gen data = 1
    label var data "Variables"
    designplot data var1 var2 var3, stat(count) min(1) max(1) variablelabels recast(hbar)
    Click image for larger version

Name:	Graph1.png
Views:	1
Size:	28.0 KB
ID:	1650857

    And when i change the missing values to 0, i got the next result:

    Click image for larger version

Name:	Graph2.png
Views:	1
Size:	27.5 KB
ID:	1650858

    Thanks everyone!


  • #2
    designplot is from the Stata Journal. Make sure you have the latest update which advises how to show missing values.

    As I write the latest is at
    gr0061_3

    . search designplot, sj

    Search of official help files, FAQs, Examples, and Stata Journals

    SJ-19-3 gr0061_3 . . . . . . . . . . . . . . . Software update for designplot
    (help designplot if installed) . . . . . . . . . . . . . . N. J. Cox
    Q3/19 SJ 19(3):748--751
    any attempt to use the missing option of graph dot,
    graph hbar, or graph bar is now ignored and advice on
    what to do instead is shown

    SJ-17-3 gr0061_2 . . . . . . . . . . . . . . . Software update for designplot
    (help designplot if installed) . . . . . . . . . . . . . . N. J. Cox
    Q3/17 SJ 17(3):779
    help file updated

    SJ-15-2 gr0061_1 . . . . . . . . . . . . . . . Software update for designplot
    (help designplot if installed) . . . . . . . . . . . . . . N. J. Cox
    Q2/15 SJ 15(2):605--606
    bug fixed for Stata 14

    SJ-14-4 gr0061 Design plots for graphical summary of a response given factors
    (help designplot if installed) . . . . . . . . . . . . . . N. J. Cox
    Q4/14 SJ 14(4):975--990
    produces a graphical summary of a numeric response variable
    given one or more factors


    Comment

    Working...
    X