Hi Rafael,

Here is a suggestion:

# Data
pos <- c(27/44, 11/32, 8/40, 4/42, 3/40, 4/40, 2/40)
tmin <- c(15.8, 12.6, 10.5, 2.4, 5.2, 8.5, 7.9)
d <- data.frame(pos, tmin)

# Non-linear model
fit <- nls(pos ~ a*tmin^b,
                 data = d,
                 start = list(a = .1, b = .1),
                 trace = TRUE)


summary(fit)

# Plot
res <- data.frame(tmin, pred = predict(fit))
plot(tmin, pos, ylim = c(0,.7))
points(res[order(tmin),], type='l', col=2)

See ?nls for more details and information. Also, take a look at ?glm and its
examples for poisson and logistic regression.

Best regards,
Jorge


On Mon, Oct 26, 2009 at 1:44 PM, Rafael Moral <> wrote:

> Dear useRs,
>
> I have the following plot:
>
>
> pos <- c(27/44, 11/32, 8/40, 4/42, 3/40, 4/40, 2/40)
> tmin <- c(15.8, 12.6, 10.5, 2.4, 5.2, 8.5, 7.9)
> plot(tmin, pos)
>
>
> I would like to fit an exponential curve to it.
> How could I be able to do this?
>
> Thanks in advance,
>
> Rafael.
>
>
>
>  
> ____________________________________________________________________________________
> [[elided Yahoo spam]]
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to