The invention relates to a microelectromechanical resonator device comprising a support structure and a semiconductor resonator plate doped to a doping concentration with an n-type doping agent and being capable of resonating in a width-extensional resonance mode. In addition, there is at least one anchor suspending the resonator plate to the support structure and an actuator for exciting the width-extensional resonance mode into the resonator plate. According to the invention, the resonator plate is doped to a doping concentration of 1.2*1020 cm−3 or more and has a shape which, in combination with said doping concentration and in said width-extensional resonance mode, provides the second order temperature coefficient of frequency (TCF2) to be 12 ppb/C2 or less at least at one temperature. Several practical implementations are presented.