3d magnetism in R2Fe14B compounds