  Phosphorus nitride (PN) is the P-bearing species with the highest number of
detections in star-forming regions. Multi-line studies of the molecule have
shown that the excitation temperature of PN is usually lower than the gas
kinetic temperature, suggesting that PN is likely in conditions of sub-thermal
excitation. We present an analysis of PN which takes the possible sub-thermal
excitation conditions into account in a sample of 24 massive star-forming
regions. We observed PN (2-1), (3-2), (4-3), and (6-5) with the IRAM-30m and
APEX telescopes and detected PN lines in 15 of them. Together with 9 similar
sources detected in PN in previous works, we have analysed the largest sample
of star-forming regions to date, made of 33 sources with 24 detections in total
(among which 13 are new detections). Hence, we have increased the number of
star-forming regions detected in PN by more than a factor 2. Our analysis
indicates that the PN lines are indeed sub-thermally excited, but well
described by a single excitation temperature. We have compared line profiles
and fractional abundances of PN and SiO, a typical shock tracer, and found that
almost all objects detected in PN have high-velocity SiO wings. Moreover, the
SiO and PN abundances with respect to H2 are correlated over several orders of
magnitude, and uncorrelated with gas temperature. This clearly shows that the
production of PN is strongly linked to the presence of shocked gas, and rules
out alternative scenarios based on thermal evaporation from iced grain mantles.
