1

I collected my data (insect biomass) fortnightly from the same trees (six trees) from February to August. The biomass curve looks like Gaussian density curve. I know that I can use optim() to fit the data. However, As I sampled the same tree repeatedly, to account for the lack of independence of the observations, I want to include 'tree id' as random effect. How can I fit the data? nlme or any other regression?

Any advice will be appreciated. Thanks for your time and help.

  • Yes, lme from nlme package or lmer from lme4 package, both can do random effecets (linear models). – user2974951 Oct 18 '18 at 10:28
  • Thank you. However, the function fitting Gaussian density curve is not linear, and involved more than one parameters, like this: k * exp(-0.5 * ((x - m)/sd)^2). If I want to fit like this post, and consider random effect. How can I do? https://stats.stackexchange.com/questions/83022/how-to-fit-data-that-looks-like-a-gaussian – Ming-Tang Shiao Oct 18 '18 at 11:41

0 Answers0