Statistics for Extended theories of gravity: the early universe and stellar interiors