Thanks for the info. I am now feeling rather clueless - using the Caligula editor, I find a "hit strength" for the hastati of 1 for the pilum and 0.3 for the sword. I guess this is lethality?

Unfortunately my EDU is for RTR 6.1, not vanilla. (I knew I should have backed up my files). It looks like lethality is 1 for ranged weapons and 0.3 for most infantry melee weapons in RTR 6.1. Pikes and spears are 0.4. Cavalry weapons seem to vary a lot and to be more lethal (0.8, sometimes 0.5). I wonder why CA introduced a lethality factor, rather than just relying on attack and defence stats as in STW and MTW?

It's not clear why any infantry would want to switch from spears to swords, as swords seem to have lower attack and lethality. I wonder if the swing speed is relevant for unit effectiveness? Or is it just cosmetic? It's zero for swords and 25 for spears. Alternatively, maybe there is a hardcoded advantage for swords over spears, as in MTW? But then again switching from spears to swords seems to be something that happens automatically in given circumstances (eg disrupted phalanx) and not something the player opts to do.