Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. set obs 10000
  2.  
  3. gen x=rnormal(0,1)
  4.  
  5. gen y=30*x +20*x^2+100*rnormal(0,1)
  6.  
  7. * put x on an ordinal scale, that runs from -5 to 5
  8.  
  9. egen xx = cut(x), group(11)
  10. replace xx=xx-5
  11.  
  12. reg y c.xx##c.xx
  13.  
  14. margins, at(xx=(-5/5))
  15. marginsplot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement