matlab 拉格朗日LM检验,求问,做LM检验和LR检验的stata命令

回复楼上,改做了LR和Wald 检验

xsmle Lngdp Score Goveff SecondaryIndustry Investment Lnpopulation stateowned ,fe model(sdm) wmat(W) type(both) nolog noeffects     #sdm模型

est store sdm_a

xsmle Lngdp Score Goveff SecondaryIndustry Investment Lnpopulation stateowned ,fe model(sar) wmat(W) type(both) nolog noeffects      #sar模型

est store sar_a

xsmle Lngdp Score Goveff SecondaryIndustry Investment Lnpopulation stateowned ,fe model(sem) emat(W) type(both) nolog noeffects      #sem模型

est store sem_a

lrtest sdm_a sar_a                        #LR test spatial lag

lrtest sdm_a sem_a                       #LR test spatial error

Wald 检验:

xsmle Lngdp Score Goveff SecondaryIndustry Investment  , wmat(W) model(sdm) robust nolog effects fe r                     #在LR之后

(xsmle y x1 x2 x3 x4)

test [Wx]Score = [Wx]Goveff = [Wx]SecondaryIndustry = [Wx]Investment = [Wx]Lnpopulation = [Wx]stateowned =0             #test [Wx]x1 = [Wx]x2 = 。。

testnl ([Wx]Score =-[Spatial]rho*[Main]Score ) ([Wx]Goveff =-[Spatial]rho*[Main]Goveff ) ([Wx]SecondaryIndustry =-[Spatial]rho*[Main]SecondaryIndustry ) ([Wx]Investment =-[Spatial]rho*[Main]Investment ) ([Wx]Lnpopulation =-[Spatial]rho*[Main]Lnpopulation ) ([Wx]stateowned =-[Spatial]rho*[Main]stateowned )

#testnl ([Wx]x1 =-[Spatial]rho*[Main]x1 ) ([Wx]x2 =-[Spatial]rho*[Main]x2) ([Wx]x3 =-[Spatial]rho*[Main]x3)