Statistical inference based on ranks