Matrix multiplication in R: requires numeric/complex matrix/vector arguments

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Matrix multiplication in R: requires numeric/complex matrix/vector arguments

zkokia
=======================================
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!


 


_______________________________________________
datatable-help mailing list
[hidden email]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help