Hi all,
I am learning mata and my goal is to develop some reading abilities of the mata code. I am following Christopher Baum's book An Introduction to Stata Programming, Second Edition. There is one usage of st_view() that is really puzzling to me in Chapter 14.11. I just pick out the part I don't understand about the usage of st_view(), and the code goes like this
So the question is, the first use of st_view() does not seem to be documented in the help file. To my understanding, the 3rd argument is a rowvector indicating which variables are included in this view. Or is this argument can be omitted? What is the result of tt?
Also, suppose everything works fine for the first 2 lines. Since touse does not include every obs, the views, tt and egg do not have the same number of rows. How is the element-wise multiplication possible in the 3rd line?
By the way, I couldn't find the author in this forum, and it might be a good idea that readers of the same stata book can get together in case anyone has a particular problem.
Thanks.
I am learning mata and my goal is to develop some reading abilities of the mata code. I am following Christopher Baum's book An Introduction to Stata Programming, Second Edition. There is one usage of st_view() that is really puzzling to me in Chapter 14.11. I just pick out the part I don't understand about the usage of st_view(), and the code goes like this
Code:
st_view(tt, ., touse) //touse is a scalar select variable, and not every obs is selected st_view(eq, .,v) //v is a rowvector containing some variable names in the current dataset eq = tt :* eqq
Also, suppose everything works fine for the first 2 lines. Since touse does not include every obs, the views, tt and egg do not have the same number of rows. How is the element-wise multiplication possible in the 3rd line?
By the way, I couldn't find the author in this forum, and it might be a good idea that readers of the same stata book can get together in case anyone has a particular problem.
Thanks.
Comment