Data overview:
> str(dataStart[c(\"gvkey\",\"DEF\",\"FittedRob\",\"NewCol\")]) \'data.frame\': 1000 obs. of 4 variables: $ gvkey : int 1004 1004
Use a bit of ave action, using the example data @Roland used:
ave
DF[ave(DF$b,DF$a, FUN=function(x) !any(x %in% c(2,3)))==1,]
And an adaptation of Jan's nice answer:
DF[!DF$a %in% unique(DF$a[DF$b %in% c(2,3)]) ,]
Both giving:
a b 5 b 5 6 b 10 9 b 5