SSexp3P {ggtrendline}R Documentation

Self-Starting Nls 'exp3P' Regression Model

Description

This selfStart model evaluates the exponential regression function (formula as: y=a*exp(b*x)+c). It has an initial attribute that will evaluate initial estimates of the parameters a, b, and c for a given set of data.

Usage

SSexp3P(predictor, a, b, c)

Arguments

predictor

a numeric vector of values at which to evaluate the model.

a, b, c

Three numeric parameters responding to the exp3P model.

Value

No return value (called for side effects).

See Also

ggtrendline, SSexp3P, SSpower3P, nls, selfStart

Examples

library(ggtrendline)
x<-1:5
y<-c(2,4,8,16,28)
xy<-data.frame(x,y)
getInitial(y ~ SSexp3P(x,a,b,c), data = xy)
## Initial values are in fact the converged values

fitexp3P <- nls(y~SSexp3P(x,a,b,c), data=xy)
summary(fitexp3P)

prediction <- predFit(fitexp3P , data.frame(x=x), se.fit = TRUE,
                          level = 0.95, interval = "confidence")
yfitexp3P <- prediction$fit
yfitexp3P  # output a matrix of predictions and bounds with column names fit, lwr, and upr.


[Package ggtrendline version 1.0.3 Index]