How is the magnetic property of an element affected when the element is part of a compound?
Magnetism appears in many very different forms that have very different origins.

All elements show some diamagnetism, even though often overshadowed by other, stronger, forms of magnetism, because it is a property of the bound electrons.
The diamagnetic contribution caused by the inner electrons that are not part of a chemical bond will therefore remain unchanged if the compound bonds chemically. The diamagnetic contribution from the electrons participating in the bond will of course change, so even for the most simple form of magnetism, it is not possible to predict the diamagnetic behavior of a compound from that of the elements.

Paramagnetic materials have a permanent magnetic moment from uncompensated magnetic moments, typically electron spins (there are exceptions where a paramagnet is formed from larger units, like magnetic particles). 
In a very simplified way, you will find unpaired electrons typically on the outer levels of elements, where they are influenced and participate in chemical bonds. This is even the case for the strongly localized d and f electrons that are characteristic for the strongest paramagnets like $\ce{Gd}$.
So clearly, paramagnetism is influenced by the chemistry.

Both diamagnetism and paramagnetism are extremely weak effects that normally don't play a role in everyday life.

Now for the 'real' forms of magnetism, ferromagnetism (ferri- antiferro and ferri etc.): All of these types of magnetism are collective phenomena, i.e. they are the result of the internal interactions of a large system, through conduction electrons (itinerant), superexchange, double exchange, etc.

Due to the collective nature, it is not possible to predict the behavior of a compound from that of the physical parameters of the elements. (Of course, you can simulate the magnetic behavior of more or less any material, but I think that was not the question)

You could not call $\ce{Fe}$ itself a ferromagnet, the ferromagnetism is a property of a huge number of $\ce{Fe}$ atoms that are acting collectively. This ensemble is very sensitive to changes, often even a small temperature change (e.g. at 20°C for $\ce{Gd}$) will completely change the magnetic properties. A chemical reaction or even simple alloying, will completely change the magnetic properties.

The macroscopic magnetic properties of a material (susceptibilitiy, coercivity, remanence, saturation magnetization, frequency dependence of parameters etc.) do not allow to predict the properties of a compound that contains this material. So you can't predict the coercivity of  $\ce{NdFeB}$ given the coercivities of  $\ce{Nd}$, $\ce{Fe}$ and $\ce B$. 

It is possible to simulate the complete electronic structure of a compound with Density Functional Theory. This simulation will tell you the magnetic parameters of the material, including the ordering temperatures in the case of ferromagnetic materials, to a varying degree of accuracy. It is a very computationally intensive approach, to compute the properties of a new material is a research project, requires some ad-hoc assumptions and will need to be experimentally verified as it is not yet 100% reliable.

This computational approach does not make any use of the macroscopic physical properties of the elements in a compound, it directly solves the many body problem of electrons and nuclei.

In summary, it is not possible to predict the change in magnetic property of a compound given the knowledge of the magnetic properties of its participating elements, but you can simulate the electronic structure of a compound, and that will tell you how the compound will behave magnetically.

Note: Neodymium magnets aren't made out of $\ce{Nd}$ metal. They are made from sintered $\ce{Nd2Fe14B}$. $\ce{Nd}$ is only a small fraction of the entire material. This is a very complex material. The exceptionally high coercivity, i.e. the resistance against a change in the magnetization, is the result of high magnetocrystalline anisotropy of $\ce{Nd2Fe14B}$ and the interfaces between the grains that pin the magnetization. This is something you would not think about given just the magnetic parameters of $\ce{Nd}$, $\ce{Fe}$ and $\ce{B}$.