updated logistict regression r code