Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: How to get parts of XB matrix


From   Austin Nichols <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: How to get parts of XB matrix
Date   Fri, 3 Jun 2011 17:56:41 -0400

Zhi Su <[email protected]> :
Something like
g xb=0
foreach v of loc X {
replace xb=xb+'v'*_b['v']
}

On Friday, June 3, 2011, Zhi Su <[email protected]> wrote:
> Dear statalist,
>
>   I run a regression Y=XB+u, with 30 independent variables. I want to
> get predicted XB of 15 independent variables among 30 independent
> variables.
>   Here are my questions
>   1.The coefficient of an independent variable x is stored in _b[x].
> Is _b[x] a vector or scalar?
>   2. Generally, I use "local" to assign X I want in to a local macro
> name. And I can easily change X in the local macro name. How can I
> utilize this local macro name when I create XB matrix with independent
> variables I want?
>
>   Thank you!
>
> --
> Zhi Su
> 348 Holmes Hall
> Northeastern University
> 360 Huntington Avenue
> Boston, MA 02115
> Office:1-617-373-2316
> email:[email protected]
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index