Using lm to estimate a parameter?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Using lm to estimate a parameter?

hellen-2
Hi,
I have a data with three variables (X,Y,Z) and I have an equation as
Z=X/(1+L*X/Y) where L is a constant which need to be estimated from data.
How should I write the formula in lm or is it possible to fit a linear
model in this case?

Thanks!
Hallen

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Using lm to estimate a parameter?

Uwe Ligges-3


On 19.02.2013 11:23, hellen wrote:
> Hi,
> I have a data with three variables (X,Y,Z) and I have an equation as
> Z=X/(1+L*X/Y) where L is a constant which need to be estimated from data.
> How should I write the formula in lm or is it possible to fit a linear
> model in this case?

Neither, it is nonlinear in the parameters. See ?nls or ?optim, for example.

Uwe Ligges



>
> Thanks!
> Hallen
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Using lm to estimate a parameter?

Hans W Borchers
Uwe Ligges <ligges <at> statistik.tu-dortmund.de> writes:
>
> On 19.02.2013 11:23, hellen wrote:
> > Hi,
> > I have a data with three variables (X,Y,Z) and I have an equation as
> > Z=X/(1+L*X/Y) where L is a constant which need to be estimated from data.
> > How should I write the formula in lm or is it possible to fit a linear
> > model in this case?
>
> Neither, it is nonlinear in the parameters. See ?nls or ?optim, for example.

Well, if the Z values are not too small, you can linearize it as

    U = (X Y - Y Z) / Z = L X

and solve it with lm(U ~ X - 1), that is without absolute term.

> Uwe Ligges
>
> >
> > Thanks!
> > Hallen
> >
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.