how to check independence assumption in r