Skip to content
Prev 179437 / 398513 Next

model fitting using by(): how to get fitted values?

Hi all,

I'm doing nonlinear regressions on data with several factors. I want to fit say a logistic curve with different parameter values for each factor level. So I'm doing something like:

tmp <- by( myData, list(myFactor1, myFactor2), function(x) nls(...) )

It works fine. However, I could not find an easy way to retrieve fitted values. I can use fitted() on each element of tmp, but that gives me as many vectors as there are combinations of factor levels.

I was thinking of using by() again, but I can't figure out how to write it properly.

Any ideas?


Thanks a lot,

Xavier
Message-ID: <2110151104.4193991241612533094.JavaMail.root@spooler8-g27.priv.proxad.net>
In-Reply-To: <1584264237.4193871241612510312.JavaMail.root@spooler8-g27.priv.proxad.net>