It depends on the specific case, since impact is used as both a noun and verb, while affect and effect in this sense are typically used as a verb and a noun respectively. In his two examples, one would be replaced with affect and one would be replaced with effect.