Announcement

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

  • Plotting category means by slightly unorthodox methods

    Here is a small curiosity, at least for private exploration before you write up that fancy state-of-the-art impossible to understand model needed for that paper.

    Code:
    . sysuse auto, clear
    (1978 Automobile Data)
    
    . lpoly mpg rep78, bw(0.5)  lineopts(recast(connected)) kernel(biweight) at(rep78)
    Click image for larger version

Name:	lpoly.png
Views:	1
Size:	12.9 KB
ID:	1111235



    The idea is ridiculously simple and obvious in retrospect. With a sufficiently small kernel width, a local polynomial smooth collapses (degenerates?) to a line plot of category means.

    It's something I keep re-discovering and somehow forgetting. Posting it may make me remember more easily.

    You could even suppress the line if you felt queasy about the connection.

    Naturally there are many other ways of getting the same plot, but this one is more amusing than most.
    Last edited by Nick Cox; 20 Mar 2015, 11:55.

  • #2
    Nick - very nice, and provocative. don't forget the ci option! thank you!

    Comment

    Working...
    X