medflex allows to run flexible mediation analyses using natural effect models as described in Lange, Vansteelandt and Bekaert (2012), Vansteelandt, Bekaert and Lange (2012) and Loeys, Moerkerke, De Smet, Buysse, Steen and Vansteelandt (2013).