2
$\begingroup$

Fitting exponential regression of form $y=ab^{x_1}c^{x_2}$ Here $x_1$ and $x_2$ are predictors and $y$ is dependent variable how to calculate $a,b,c$ using R tool

$\endgroup$
1
  • 3
    $\begingroup$ Are you expecting the errors to be additive ($y=ab^{x_1}c^{x_2}+\epsilon$) or multiplicative ($y=ab^{x_1}c^{x_2}\epsilon$)? $\endgroup$ Jan 6, 2013 at 4:49

1 Answer 1

2
$\begingroup$

If the model is: log(y) ~ a + b*X1 + c*X2 with Poisson errors, .... then it would be as simple as:

glm( y ~ X1 + X2, data = dfrm, family="poisson")

You could get one kind of "additive" model with:

glm( log(y) ~ X1+X2, data=dfrm, family="gaussian")
$\endgroup$
4
  • $\begingroup$ Considering additive errors,Model that is to be fit is y=ay=ab^(x1)c^(x2) and if this equation is being log trransformed then for zeros in dataset R cannot generate equation as log(0) becomes infinity. $\endgroup$
    – Komal
    Jan 6, 2013 at 5:03
  • 1
    $\begingroup$ Then look at ?nls. $\endgroup$
    – DWin
    Jan 6, 2013 at 5:06
  • 1
    $\begingroup$ you can use glm(y ~X1+X2, data=dfrm, family=gaussian(link="log")); log-transformation is not involved ... $\endgroup$
    – Ben Bolker
    Jan 6, 2013 at 16:51
  • $\begingroup$ ... and the statistical model is actually Y~Poisson(lambda=exp(a+b*log(X1)+c*log(X2))) (equivalent to lambda=exp(a)*X1^b*X2^c), so that should be glm(y~log(X1)+log(X2), ...) $\endgroup$
    – Ben Bolker
    Jan 6, 2013 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.