Announcement

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

  • Problems with generating basic bar graphs.

    Hello. For the past two hours I have been trying to generate a series of graphs for a project I am working on and have to make public today. Unfortunately, I cannot generate bar graphs. Even a simple command like:

    Graph bar, over(country_dir)

    Results in an error that says: “varlist or statlist required”.

    “country_dir” is a string variable variable that takes values “Right direction and Wrong direction”. I have tried recoding it as a numeric variable but still have the same error.

    I use Stata MP 13. Please I need help urgently.

  • #2
    You'll probably want to post or attach your dataset, and post your actual code as a do-file between [code]. . .[/code] delimiters, because
    Code:
    set obs 20
    generate str country_dir = cond(mod(_n, 2), "Right direction", "Wrong direction")
    graph bar , over(country_dir)
    works for me.

    Comment


    • #3
      This syntax was introduced on 9 October 2014. Check your Stata is to up-to-date by

      Code:
      update query

      Comment

      Working...
      X