Estimating the magnitude by P waves is important for issuing the earliest message to the general public during earthquake early warning (EEW). First, we reviewed part of the magnitude estimation results of the current EEW system deployed in Yunnan and found that the magnitude is seriously underestimated by 0.9 for the main shock of the Yangbi earthquake sequence (MS 6.4, as determined formally by the Yunnan Seismic Network) and overestimated for a number of small earthquakes. Then, we determined the reason of this phenomenon and improved the magnitude estimating precision in Yunnan by introducing the fixed effects regression technique and compensating for the viscoelastic attenuation. Finally, we discussed the deficiencies of this magnitude estimation approach.