[英]How to estimate parameters of exponential function with R?
I am working on an investigation on ichthyofauna (study of fishes).我正在对 ichthyofauna(鱼类研究)进行调查。 I need to find the condition factor of the fish.
我需要找到鱼的条件因素。 The steps to find the condition factor are as follows:
查找条件因子的步骤如下:
1. W = aL^b... (1) 1. W = aL^b... (1)
Where:在哪里:
2. Log w = log a + b log L... (2) 2. Log w = log a + b log L... (2)
Where:在哪里:
3. K = 100 w/L^b... (3) 3. K = 100 w/L^b... (3)
Where:在哪里:
I understand that to calculate K, I must first obtain the regression slope (b of 1), then the co-efficient regression (b of 2) and finally K. I need help to do it in R.我知道要计算 K,我必须首先获得回归斜率(1 的 b),然后是系数回归(2 的 b),最后是 K。我需要在 R 中获得帮助。 I would be very grateful for your support.
我将非常感谢您的支持。 Thanks and regards!
谢谢并恭祝安康!
so for a very simple regression, you may want to start with a linear model, and you'd do something like this:所以对于一个非常简单的回归,你可能想从线性 model 开始,你会做这样的事情:
reg1 <- lm(log(W) ~ log(L), data=yourdataframename)
then check the summary for coefficients:然后检查系数的摘要:
summary(reg1)
Note you don't need to take a log of the intercept because it is a column of ones essentially (but it is included implicitly unless you put '-1' in your parameters)请注意,您不需要记录截距,因为它本质上是一列(但除非您在参数中输入“-1”,否则它会被隐式包含)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.