Announcement

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

  • Problem producing a graph displaying two x-axis variables, one y-axis variable using binscatter

    So I'm currently a student and started using Stata yesterday. I've been using the SSC command binscatter. Is there any way to plot two independent variables to compare them to each other using a dependent variable using the binscatter command? If I try to produce it using the normal scatter command the outputted graph is not easy to interpret, hence why I need to use the binscatter command. However, when using the binscatter command it returns that binscatter is not a twoway plot type. An example of what I would like my graph to look like is attached, the only difference being I don't need a second y-axis on the right-hand side. Apologies if anything in this post has gone against the rules.

    Click image for larger version

Name:	1.png
Views:	1
Size:	8.9 KB
ID:	1660386
    Last edited by Jonny McCann; 19 Apr 2022, 07:08.

  • #2
    The only rules here are not to post assignments and expect us to do the work, not to spam and not to be offensive. You're doing fine there so far as I can tell.

    Otherwise, you're not showing the command you tried and you're not showing example data and you want a graph like that shown except that the graph shown is not like what you want.

    In fact what the example shows, if I understand correctly. is a graph with two y variables smoothed against one x variable, time. But you say you have two x variables and one y variable.

    Sorry, you've lost me there, but do try again with a real or realistic data example.

    binscatter is just one way of getting smoothed series and in my view not even the most flexible.

    Comment


    • #3
      Hi Nick, thank you for your quick response, I appreciate it. Unfortunately I couldn't edit the post and so I remade a new post to ask this question.
      Otherwise, you're not showing the command you tried and you're not showing example data and you want a graph like that shown except that the graph shown is not like what you want.

      In fact what the example shows, if I understand correctly. is a graph with two y variables smoothed against one x variable, time. But you say you have two x variables and one y variable.
      In the new post I added the code I was using and removed the graph as I realised it wasn't really showing what I wanted clearly so thanks for pointing that out.

      Sorry, you've lost me there, but do try again with a real or realistic data example.
      Yes, I've seen that it is recommended I should give an example using the dataex command but I'm unsure how to use this to illustrate what I mean.

      Comment


      • #4
        If interested, please follow https://www.statalist.org/forums/for...ng-bin-scatter

        Comment

        Working...
        X