Previous simulations predicted the activity-induced radial-velocity (RV) variations of M dwarfs to range from ~1cm/s to ~1km/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-1um), 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 Halpha 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 >10m/s and a projected rotation velocity vsini>2km/s are caused mainly by activity. We name these stars 'active RV-loud stars' and find their occurrence to increase with spectral type: from ~3% for early-type M dwarfs (M0.0-2.5V) through ~30% for mid-type M dwarfs (M3.0-5.5V) to >50% for late-type M dwarfs (M6.0-9.0V). Their RV-scatter amplitude is found to be correlated mainly with vsini. 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 Halpha 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.