I'm trying to subset a given dataset by the years of education of the individuals. In particular, I would like to make a smaller dataset with individuals that have only 15 or 16 years of education.
However, when I try to do it through the command | to include both possible values, it gives me back the whole sample. This is not the case If I subset the data to individuals with just 15 or 16 years of edcuation, as it seems to work correctly here. It doesn't when I include both at the same time though.
The line of code I use is this one
dataset_final <- subset(dataset_trade , Q119 == 15 | 16 )
Any idea what might be causing the problem?