SSpower3P | R Documentation |
This selfStart model evaluates the power regression function (formula as: y=a*x^b+c). It has an initial attribute that will evaluate initial estimates of the parameters a, b, and c for a given set of data.
SSpower3P(predictor, a, b, c)
predictor |
a numeric vector of values at which to evaluate the model. |
a, b, c |
Three numeric parameters responding to the exp3P model. |
No return value (called for side effects).
ggtrendline
, SSexp3P
, SSpower3P
, nls
, selfStart
library(ggtrendline) x<-1:5 y<-c(2,4,8,20,25) xy<-data.frame(x,y) getInitial(y ~ SSpower3P(x,a,b,c), data = xy) ## Initial values are in fact the converged values fitpower3P <- nls(y~SSpower3P(x,a,b,c), data=xy) summary(fitpower3P) prediction <- predFit(fitpower3P , data.frame(x=x), se.fit = TRUE, level = 0.95, interval = "confidence") yfitpower3P <- prediction$fit yfitpower3P # output a matrix of predictions and bounds with column names fit, lwr, and upr.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.