I am trying to compare means of categorical data, that is education (integer) grouped by sex (Male and Female). So I have used the following code to view their means:
The result would be the same even if there was a single NA value in each category. If you want to ignore those values, then you need to add the na.rm = TRUEargument to the mean() function: