Rank based diagnostics for the integration order of a VAR model