Displaying 2 results from an estimated 2 matches for "myfactor2".
Did you mean:
myfactor
2009 May 06
1
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 w...
2012 Oct 27
1
contr.sum() and contrast names
...not equivalent to levels of a factor, because one needs to
know the reference (here, level or sum) to interpret them. But when one
knows the type of contrasts that are being used, useful labels are still
of high value. I don't think anybody does serious work with sum
contrasts named myfactor1, myfactor2, myfactor3. (This reasoning does
not so much apply to contr.helmert() since ordered factors can quite
naturally be reported using numbers.)
Thus, would it be possible to add an option to contr.sum() so that it
returns a matrix whose column names are the levels of the input factor?
Such an option c...