Announcement

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

  • Margins & Margins plot with quadratic spline functions

    Hi!

    I'm interested in changes in network size before and after widowhood.
    I modeled three variables, f1 for linear change, f2 for quadratic change before widowhood; and f3 for quadratic change after widowhood.

    Code:
    gen f1=year-widowhood_year
    gen f2=(year-widowhood_year)^2 if year<= widowhood_year
    gen f3=(year-widowhood_year)^2 if year>widowhood_year
    I ran xtmixed and both f2 and f3 were statistically significant, indicating that the increase in network size tapered off with time after widowhood.

    Code:
    xtmixed size income retired health f1 f2 f3 || id : f1 age educ female
    If I want to create graph that looks like this, showing the quadratic change before and after widowhood, what would be my next step?

    Thank you!

    Click image for larger version

Name:	Screenshot 2022-05-04 114635.png
Views:	1
Size:	135.2 KB
ID:	1663028
    Last edited by Jina Sarah Lee; 04 May 2022, 11:07.
Working...
X