Systematic study of directed flow at RHIC energies