<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>=======================================</div><div>Error in Ws %*% as.matrix(endog) : <br>requires numeric/complex matrix/vector arguments</div><div>=======================================</div><div><br>where ¡®Ws¡¯ is a N*N spatial weight matrix and ¡®endog¡¯is N*3 (we have three endogenous variables)<br>I cannot understand why this error occours because when I set only one endogenous variable my code works well.<br>What's more, three endogenous variables are not dummy.<br>Is it because that two of these endogenous variables are interaction? Or because of the package 'splm/spgm' cannot allow for extra endogenous variables?</div><div><br>Here is part of my code:</div><div>c11_omega <- interaction(mydata$c11,mydata$omega)<br>d11_omega <- interaction(mydata$d11,mydata$omega)<br>endog = ~ omega + c11_omega + d11_omega<br>instruments = ~ XI + c11_XI + d11_XI</div><div><br></div><div>and the regression is:<br>fm <- ex ~ c11 + d11 + control variables</div><div><br></div><div><br></div><div>Thanks for your help!<br></div></div><br><br><span title="neteasefooter"><p> </p></span>