fitting a curved line/non linear model

2 views
Skip to first unread message

Kyran Staunton

unread,
Sep 26, 2012, 1:57:27 AM9/26/12
to tropi...@googlegroups.com
Hi all,

I have run linear regression models to investigate correlations
between ordination Y axis values and environmental data (temp,
precip).

My data is very simple,

Y precip temp
-0.047153802 3304 23.1
-0.031660706 3293 23.1
-0.033153648 3285 23
-0.317914778 2806 22.1

but I am having issues using nls to fit a non linear regression model
to them, which I assume will have better fits.

The shapes of my curves are something like:

Y~ - temp^3

&

Y~ precip^1/3

Any tips regarding fitting curves to data with R or creating non
linear models like this would be greatly appreciated,

Cheers,

Kyran.
BC01&BC12_vs_Y.png

Phillips, Ben

unread,
Sep 26, 2012, 2:05:29 AM9/26/12
to <tropical-r@googlegroups.com>
If you have clear expectations for your exponents you could just transform and do linear fits.

Otherwise nls issues might be related to your initial values to the optimizer.

B

Excuse the brevity: sent from my phone.
> --
> An R group for questions, tips and tricks relevant to spatial ecology and climate change.
> All R questions welcome.
> ---
> You received this message because you are subscribed to the Google Groups "Tropical R" group.
> To post to this group, send an email to tropi...@googlegroups.com.
> To unsubscribe from this group, send email to tropical-r+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> <BC01&BC12_vs_Y.png>

Reply all
Reply to author
Forward
0 new messages