as a substitute for vs in preference to

as a substitute for

in preference to

How often have the words as a substitute for and in preference to occurred in a corpus of books? (source: Google Ngram Viewer )