I am new to R. I want to ask a question below:
Here is the data:
year <- c(2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015)
score1 <- c(35, 40, 45, 59, 62, 71, 78, 65, 78, 82, 89, 85, 78, 88, 96, 98)
score2 <- c(56, 45, 45, 59, 65, 73, 79, 69, 79, 88, 89, 88, 72, 85, 98, 92)
score <- array(c(score1, score2))
I have tried segmented package, but I found that it always calculate the breakpoints in the system.
I want to set 2008 as the breakpoint to do the piecewise linear fitting. I also want to know the intercept, slope and p value. How can I do it in R Studio? Thanks.