[R] (no subject)
Abs Spurdle
@purd|e@@ @end|ng |rom gm@||@com
Tue Apr 23 04:04:56 CEST 2019
Note that your post has no subject line.
I can't find it in my emails, which may explain why no one else has replied.
> fo<-h~a+b*log(dbh)+c*(log(dbh))^2+1.3
I'm assuming that you want to fit a model with three parameters, a, b and c.
This would be a linear model (linear in the parameters).
I'm going to ignore the +1.3 (because you don't need two intercepts),
but you can modify the following script if you want.
> I want to compute a nlm for each plot
So, three models?
How about this:
> r1 = lm (h ~ log (dbh) + I ( (log (dbh) ) ^ 2), data=ah [ah$plot=="Sinca",])$coef
> r2 = lm (h ~ log (dbh) + I ( (log (dbh) ) ^ 2), data=ah [ah$plot=="budeni",])$coef
> r3 = lm (h ~ log (dbh) + I ( (log (dbh) ) ^ 2), data=ah [ah$plot=="Ceahlau",])$coef
> params = rbind (r1, r2, r3)
> rownames (params) = c ("Sinca", "budeni", "Ceahlau")
> colnames (params) = c ("a", "b", "c")
> params
a b c
Sinca -13.05110 5.657927 1.606357
budeni -2.11277 3.997636 1.104683
Ceahlau -135.57911 82.836952 -10.918932
More information about the R-help
mailing list