Yeah... it's a bit of a complicated, scaling formula but short version is that +1 Magic or +1 Strength both increase damage by similar amounts.
Technically Magic gives you a slight amount more damage per 1 extra point, but it's marginal and it also its advantage over Strength has diminishing returns as you level-up (because of the weighting the formula gives character level and weapon Attack). Hammers and Axes with Vitality, and Daggers and Ninja Swords with Speed are the same weight, but respectively weight even slightly more to their alternative stat at Lv1 but reduce the the same diminished returns as Katanas by Lv99.
I delved into it a lot more over a week ago
if you want to read it here (formula anaylsis), but short answer is they're close enough that you'd always favour whichever one gives you more. E.g. 5 Strength over 4 Magic, and though 4 Magic is very slightly better than 4 Strength, it's so marginal and diminishing that any other benefits (e.g. Defense) likely outweigh it.