[datatable-help] Matrix multiplication in R: requires numeric/complex matrix/vector arguments

Kokia Z zkokia at 163.com
Mon Aug 28 13:18:23 CEST 2017


=======================================
Error in Ws %*% as.matrix(endog) :
requires numeric/complex matrix/vector arguments
=======================================

where ‘Ws’ is a N*N spatial weight matrix and ‘endog’is N*3 (we have three endogenous variables)
I cannot understand why this error occours because when I set only one endogenous variable my code works well.
What's more, three endogenous variables are not dummy.
Is it because that two of these endogenous variables are interaction? Or because of the package 'splm/spgm' cannot allow for extra endogenous variables?

Here is part of my code:
c11_omega <- interaction(mydata$c11,mydata$omega)
d11_omega <- interaction(mydata$d11,mydata$omega)
endog = ~ omega + c11_omega + d11_omega
instruments = ~ XI + c11_XI + d11_XI


and the regression is:
fm <- ex ~ c11 + d11 + control variables




Thanks for your help!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20170828/a5ef8638/attachment.html>


More information about the datatable-help mailing list