Hi Statalist,
I used some Mata functions, and used st_view() to get the matrix from data,
then use st_subview() to get a submatrix from that matrix.
------ Mata code -------
real matrix V, Yall, Xall
neq = st_local("neqn")
st_view(V,., tokens(varname))
st_subview(Yall,V,.,(1\neq))
st_subview(Xall,V,.,(neq+1\cols(V)))
It reported the error:
mysub(): 3250 type mismatch
<istmt>: - function returned error
I tried different ways, but not working also.
Yall = V[|1,1 \ rows(V),neq|]
Xall = V[|1,neq+1 \ rows(V), cols(V)|
This way also does not working
for(i=1;i<=neq;i++) {
Yall = Yall , V[.,i]
}
for(i=neq+1;i<=nrows;i++) {
Xall = Xall , V[.,i]
}
I don't know how to fix that problem. Anyone can help me out?
Thanks so much,
Minh
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/