Hi Statalist users,
I would like to create a spline variable of year so that I can look at the period between 2001 and 2008; 2009; 2010 - 2016. I've tried using the mkspline command, which successfully creates the spline variables but when I enter them all in at once, one is left out due to collinearity so I fear I may be creating them wrong. The command i am using is this:
mkspline year1 2001 year2 2008 year3 2008 year4 2009 year5 2016 year6 = year, marginal
I am using it for an OLS regression on full-time employment:
I would like to create a spline variable of year so that I can look at the period between 2001 and 2008; 2009; 2010 - 2016. I've tried using the mkspline command, which successfully creates the spline variables but when I enter them all in at once, one is left out due to collinearity so I fear I may be creating them wrong. The command i am using is this:
mkspline year1 2001 year2 2008 year3 2008 year4 2009 year5 2016 year6 = year, marginal
I am using it for an OLS regression on full-time employment:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte activity_gendered1 int year 1 2012 0 2006 1 2002 0 2016 0 2014 1 2013 1 2008 1 2010 1 2016 1 2016 1 2002 0 2010 1 2010 0 2011 0 2010 1 2014 1 2016 0 2001 1 2016 1 2009 1 2004 1 2016 1 2001 1 2012 1 2015 1 2015 1 2011 1 2005 0 2001 1 2013 1 2001 1 2014 1 2009 1 2002 1 2013 1 2016 1 2015 0 2013 1 2011 1 2006 1 2005 0 2012 1 2016 1 2013 0 2001 0 2006 1 2015 1 2011 0 2004 1 2007 1 2008 1 2016 1 2012 0 2013 0 2013 1 2012 1 2010 1 2007 1 2014 1 2004 1 2009 0 2014 1 2009 0 2013 1 2013 1 2010 1 2015 1 2013 1 2006 0 2009 1 2006 1 2011 1 2005 1 2008 1 2001 0 2014 0 2011 1 2009 0 2014 1 2008 0 2005 0 2014 0 2010 1 2004 1 2007 0 2016 1 2003 1 2013 0 2002 1 2005 1 2009 1 2011 1 2013 1 2004 1 2005 1 2001 0 2007 0 2013 0 2013 1 2016 end
Comment