[R] lm regression: estimate of a categorical variable without being broken into levels
Achim.Zeileis at wu-wien.ac.at
Tue Dec 21 21:42:26 CET 2004
On Tue, 21 Dec 2004 12:06:47 -0800 (PST) avneet singh wrote:
> I am new to R and am going through the growing pains,
> wonder if you could help alleviate some.
> I wished to find the estimate for a categorical
> variable without it being broken into levels but dont
> know how to.
> if I use the following example:
> I get the estimate of the categorical variable
> "Species" broken up into levels.
> Now i get values pertaining to the variable "Species"
> without the levels being broken but i do not get the
There is not "the estimate", there are two estimates (as reported in the
summary above), hence are 2 Df associated with Species.
> Question: Is there a formulae which provides the
> values that "summary" provides but doesnt break up the
> categorical variable into levels?
It is not at all clear to me what you really want. It is the nature of a
categorical variable to fall into different categories (aka levels). If
you want to treat it as if it were numeric, you can transform it to a
numeric variable (not that it would make much sense in this example).
It is also possible that what you are looking for are different
contrasts. See ?contrasts or the corresponding section in MASS4 (the
> Thank you
> There are lies, damned lies and statistics.
> ~Mark Twain
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide!
More information about the R-help