Announcement

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

  • graph matrix - problem combining diagonal and by options

    Code:
    clear
    set obs 20
    
    gen y1 = rnormal()
    gen y2 = rnormal()
    gen y3 = rnormal()
    
    gen grp = 1
    replace grp = 2 in 11/20
    
    graph matrix y1 y2 y3, diagonal("First" "Second" "Third")
    graph matrix y1 y2 y3, by(grp)
    graph matrix y1 y2 y3, diagonal("First" "Second" "Third") by(grp)
    This code creates some dummy data and tries to create some scatter plot matrices. The first two graph matrix commands work fine but the last line which tries to combine the diagonal and by options doesn't. I don't understand the error message given "option plegend() not allowed" as I couldn't seem to find any information about such an option.
    I am using Stata/IC 15.1 but I had used this combination of options without any problems in previous versions of Stata.

    Any suggestions?
Working...
X