Announcement

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

  • How to design a correct twoway scatter graph?

    Good morning to the community.

    I would like to design a graph like this:
    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	39.9 KB
ID:	1613554


    But I would like firm_performance as yaxis and intangible_assets as xaxis.

    I runned this command but I have an error code: "industry: may not use time-series operators on string variables" r(109).
    Code:
    scatter firm_performance intangible_assets, ylabel(minmax) xlabel(minmax), mlabel(industry), lfit fir
    > m_performance intangible_assets, clstyle(p2)
    Attached Files

    Lucas BORDURE
    Student MSc. in International Finance
    Rennes School of Business
    Stata SE 16.1

  • #2
    Stata can't understand your syntax. If you get too far from correct syntax Stata just gets confused. This isn't enormously different from ordinary language.

    Although there can be exceptions, the rule to follow is one and only one comma separating options from the rest of the command. Also you need different syntax for superimposing scatter and lfit.


    Code:
     
     scatter firm_performance intangible_assets, ylabel(minmax) xlabel(minmax)  mlabel(industry) || lfit firm_performance intangible_assets, clstyle(p2)
    Here the marker labels might as well be put where the marker symbols are.

    Code:
     
     scatter firm_performance intangible_assets, ms(none) ylabel(minmax) xlabel(minmax)  mlabel(industry) mlabpos(0) || lfit firm_performance intangible_assets, clstyle(p2)


    Comment


    • #3
      Thank you for your explanation concerning the syntax of options which is separated from the rest of the command.
      Thank you also for your explanation concerning the syntax to establish to superpose scatter and lfit.

      Lucas BORDURE
      Student MSc. in International Finance
      Rennes School of Business
      Stata SE 16.1

      Comment

      Working...
      X