Nanomechanical properties of piezoresistive cantilevers: Theory and experiment