  The elliptic azimuthal anisotropy coefficient ($v_{2}$) of the identified
particles at midrapidity ($|\eta|<0.8$) was investigated in p--Pb collisions at
$\sqrt{s_\mathrm{NN}}=$ 5.02 TeV using a multi-phase transport model (AMPT).
The calculations of differential $v_{2}$ based on the advanced flow extraction
method of light flavor hadrons (pions, kaons, protons, and $\Lambda$) in small
collision systems were extended to a wider transverse momentum
($p_{\mathrm{T}}$) range of up to 8 GeV/$c$ for the first time. The
string-melting version of the AMPT model provides a good description of the
measured $p_{\mathrm{T}}$-differential $v_{2}$ of the mesons but exhibits a
slight deviation from the baryon $v_{2}$. In addition, we observed the features
of mass ordering at low $p_{\mathrm{T}}$ and the approximate number of
constituent quarks (NCQ) scaled at intermediate $p_{\mathrm{T}}$. Moreover, we
demonstrate that hadronic rescattering does not have a significant impact on
$v_{2}$ in p--Pb collisions for different centrality selections, whereas
partonic scattering dominates in generating the elliptic anisotropy of the
final particles. This study provides further insight into the origin of
collective-like behavior in small collision systems and has referential value
for future measurements of azimuthal anisotropy.
