Announcement

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

  • Scatterplot in stata gone wrong. What's wrong with my code?

    Click image for larger version

Name:	Screenshot 2024-05-21 at 12.07.02.png
Views:	1
Size:	47.2 KB
ID:	1753944




    twoway (scatter percentlessthan35 percent55andup) (function y = x, range(.1490401 1) lc(red)), legend(off)
    So basically, I expected it to be scattered? I don't know where I went wrong.

    Other notes: range(.1490401 1) is the range for percentlessthan35 (so i can make a line).

    Thank you in advance!

  • #2
    Cross-posted and answered on Stack Overflow. https://stackoverflow.com/questions/...g-with-my-code

    Please read the Statalist FAQ before posting, especially #6 (full real names please), #8 (tell us about cross-posting), #12 (give data example to get full explanations).

    You should be looking at your data.

    Your two variables plot on the line y = 1 - x, or equivalently y + x = 1.

    Two variables that are supposedly "percents" (but really proportions between 0 and 1) are just complementary. From the names. there may be a third variable that happens to have values of 0 in practice.

    Comment


    • #3
      Hey Nick. I see and will look into my data. Thank you!

      Comment

      Working...
      X