  Previous simulations predicted the activity-induced radial-velocity (RV)
variations of M dwarfs to range from $\sim1$ cm/s to $\sim1$ km/s, depending on
various stellar and activity parameters. We investigate the observed relations
between RVs, stellar activity, and stellar parameters of M dwarfs by analyzing
CARMENES high-resolution visual-channel spectra ($0.5$$-$$1$$\mu$m), which were
taken within the CARMENES RV planet survey during its first $20$ months of
operation. During this time, $287$ of the CARMENES-sample stars were observed
at least five times. From each spectrum we derived a relative RV and a measure
of chromospheric H$\alpha$ emission. In addition, we estimated the chromatic
index (CRX) of each spectrum, which is a measure of the RV wavelength
dependence. Despite having a median number of only $11$ measurements per star,
we show that the RV variations of the stars with RV scatter of $>10$ m/s and a
projected rotation velocity $v \sin{i}>2$ km/s are caused mainly by activity.
We name these stars `active RV-loud stars' and find their occurrence to
increase with spectral type: from $\sim3\%$ for early-type M dwarfs
(M$0.0$$-$$2.5$V) through $\sim30\%$ for mid-type M dwarfs (M$3.0$$-$$5.5$V) to
$>50\%$ for late-type M dwarfs (M$6.0$$-$$9.0$V). Their RV-scatter amplitude is
found to be correlated mainly with $v \sin{i}$. For about half of the stars, we
also find a linear RV$-$CRX anticorrelation, which indicates that their
activity-induced RV scatter is lower at longer wavelengths. For most of them we
can exclude a linear correlation between RV and H$\alpha$ emission. Our results
are in agreement with simulated activity-induced RV variations in M dwarfs. The
RV variations of most active RV-loud M dwarfs are likely to be caused by dark
spots on their surfaces, which move in and out of view as the stars rotate.
