If it isn't possible for the treatment to actually be applied, prima facie it makes less sense to include those data in the analysis. This suggests you should just throw them out as outliers—i.e., data that come from a data generating process other than what you are studying. However, I would argue that it's best to keep them. I would use one or both of the following approaches:
- Mark those who could not receive the treatment with an indicator variable, whether they were actually in the intervention group or not. Then fit a model with
treatment.group
, not.treatable
and the interaction, treatment.group X not.treatable
, all included. You can test the interaction, and the simple effect of being in the treatment group when it could possibly be applied. If you use reference level coding and make those who could not receive the treatment the reference level of the not.treatable
factor, what the model will display as the 'main effect' of treatment.group
will actually be the simple effect of interest.
- Ignore the fact that some people will not be able to get the treatment and simply test
treatment.group
(e.g., with a $t$-test). This is a test of the marginal association of being assigned to the treatment with the response. You could also just estimate the means of the treatment groups (again without taking whether people can get the treatment into account) and the standardized mean difference.
Number 2 may seem like an odd suggestion. In fact, you may not end up using it, but it's worth considering. There is a concept in biomedical sciences / epidemiology called "efficacy vs. effectiveness" (see also this CV thread: What is the difference between effectiveness and efficacy in determining the benefit of therapy 'A' on condition 'B'?). The idea is that an intervention has a possible pure effect which can be measured under ideal conditions, but which is likely to have a lesser effect in practice when conditions are not ideal, and that it would be worth knowing what both of those magnitudes are. In your case, 1 lets you test your treatment effect and tells you its 'true' (in some sense) magnitude, but 2 tells you how well to expect it to work in the future, since evidently you won't know in advance if the treatment can actually be applied when you try it.