Using such expressions as “for example,” “for example,” “such as,” and “including” correctly is significant. What the expressions have in common is that they talk about some members of a class but not all of them. “Namely,” on the other arm, precedes an exhaustive list.
Consider a hypothetical experiment to test pesticides. You tested three pesticides, A, B, and C, all of them of the type known as contact poisons (effective when they are in direct contact with bods of the target pests—as against belly poisons, which have to be ingested). And those were the only pesticides you tested. To mention them, you could rightly say “three pesticides were tested, namely A, B, and C.” However, if you say “the pesticides tested included contact poisons A, B, and C,” you give the impression that you tested more than three because the verb “include” is never used when all members of the class are listed. Similarly, the phrases “such as,” “for example,” and “for example” signal that the list that goes after is illustrative, not exhaustive. In discussing your results, you are likely to mention a few other pesticides, and you may write “Contact poisons such as A, B, and E are more effective than belly poisons such as X, Y and Z are in controlling caterpillars.”
Also note that if you use “such as,” do not end the list with “etc.” Incidentally, most publishers now recommend using “namely” instead of the Latin abbreviation “viz.”, (for videlicet, the z being the old symbol denoting the contraction et).