Announcement

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

  • mkspline

    Hello,

    I am trying to join point regression with the mkspline command (data below). I am tying the knot at 2011 since I want to find the significance of the change after that year. I am having trouble with putting the output in a graph. Any help would be great thanks.
    Year Rates
    2001 3.918019302
    2002 4.148348146
    2003 4.227078546
    2004 4.555038034
    2005 4.640286453
    2006 4.7194585
    2007 4.822999689
    2008 4.539245074
    2009 4.434698719
    2010 4.696317036
    2011 4.890968611
    2012 5.484549376
    2013 5.939074678
    2014 6.112666889

  • #2
    Code:
    clear all
    input Year     Rates
    2001     3.918019302
    2002     4.148348146
    2003     4.227078546
    2004     4.555038034
    2005     4.640286453
    2006     4.7194585
    2007     4.822999689
    2008     4.539245074
    2009     4.434698719
    2010     4.696317036
    2011     4.890968611
    2012     5.484549376
    2013     5.939074678
    2014     6.112666889
    end
    
    mkspline year1 2011 year2 = Year
    
    reg Rates year1 year2
    margins, over(Year)
    marginsplot,                                ///
        addplot(scatter Rates Year, msymbol(o)) ///
        ciopts(recast(rarea) astyle(ci) )
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Thank you so much Maarten .
      Last edited by Vikas Arya; 05 Dec 2019, 02:09.

      Comment

      Working...
      X