[R] delete categories

Mark Difford mark_difford at yahoo.co.uk
Mon Nov 17 09:42:46 CET 2008


Hi Ann,

>> I want to delete one category from the dataset ... I have tried the omit
>> command but it just returns TRUE and False values.


You are leaving the list to guess at what you have tried, and which
functions you are using.

There are several different ways of omitting or dropping categories
(permanently?, or temporarily in a call to a function?). If the function you
are using to fit the model uses the formula interface then the following
should do what you want. If not, then ... please read the posting guide.

##
glm(response ~ predictor, data = YourData, subset = Category != "G", family
= ...)

You will need to do the appropriate substitutions ... This should omit the
data associated with category G.

Regards, Mark.


Ann Leis wrote:
> 
> I have a dataset which has categories A-G (7 categories) with
> corresponding
> x and y variables.  I want to delete one category from the dataset and run
> a
> logit model on only 6 categories instead of 7. How do I delete a category?
> I
> have tried the omit command but it just returns TRUE and False values.
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org 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.
> 
> 

-- 
View this message in context: http://www.nabble.com/delete-categories-tp20533194p20535629.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list