« Return to Thread: delete categories

Re: delete categories

by Mark Difford :: Rate this Message:

Reply to Author | View in Thread

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@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.

 « Return to Thread: delete categories