Filtering a layer should exclude the filtered data from any analyses - that's an advantage of a filter vs just visually excluding those features with rule-based symbology. Sometimes there are bugs where filtered data is actually included, so it's safest to create a separate shapefile. There are multiple ways to do this, here are two:
The Split Vector Layer tool
"This algorithm takes a vector layer and an attribute and generates a set of vector layers in an output folder. Each of the layers created in that folder contains all features from the input layer with the same value for the specified attribute.
The number of files generated is equal to the number of different values found for the specified attribute." - QGIS Split Vector Layer tool description
Select the features you want to extract. Right click on the layer name (in the layer panel) > Export > Save Selected Features as...
- Use the Select Features by Value, Select Features by Expression, and Invert Select tools to select exactly the features you want
Filter..., i.e."COLOUR" = 'RED'– Taras Nov 08 '18 at 18:08