Description Usage Arguments Value Author(s) See Also Examples
Calculates the total residual sum of squares for broken stick model (2 part)
1 |
data |
data frame for calculating total residual sum of squares. |
break.pt |
This is the data point at which the data are split for a broken stick model. |
xvar |
The x-variable in the data frame for broken stick model. |
yvar |
The y-variable in the data frame for broken stick model. |
The residual sum of squares of a broken stick model with a specified break point.
Tyler L. Moulton
codesumsq codeget.pcrit
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## load data ##
data(fishMR)
## subset data to appropriate region ##
data<-fishMR[fishMR$DO.mgL < 4,]
data$times <- data$times-min(data$times)
data<-data[data$times< 6800,]
## calculate total RSS for different breakpoints ##
a1 <- tot.rss(data, break.pt = 4000,
xvar = "times", yvar = "DO.mgL")
a2 <- tot.rss(data, break.pt = 4250,
xvar = "times", yvar = "DO.mgL")
a3 <- tot.rss(data, break.pt = 4500,
xvar = "times", yvar = "DO.mgL")
a4 <- tot.rss(data, break.pt = 4750,
xvar = "times", yvar = "DO.mgL")
a5 <- tot.rss(data, break.pt = 5000,
xvar = "times", yvar = "DO.mgL")
a6 <- tot.rss(data, break.pt = 5250,
xvar = "times", yvar = "DO.mgL")
# a5 represents the break point for the
# best broken stick linear model of the
# above 6 options.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.