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]

st: RE: RE: Problem returning the e(V) covariance matrix for looped regression


From   "Jesper Lindhardsen" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: Problem returning the e(V) covariance matrix for looped regression
Date   Mon, 10 Oct 2011 12:54:49 +0200

Ahh, Nick beat me to it. By the way I forgot to use quotes as I used
strings in my example......
Jesper

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Jesper
Lindhardsen
Sent: 10 October 2011 12:52
To: [email protected]
Subject: st: RE: Problem returning the e(V) covariance matrix for looped
regression

Hi Sharon

I would use a loop and regress with an if statement (eg. reg x y if
country=='Norway') and copy e(V) into a matrix within the loop.

Something like

local name: "Norway Denmark"
foreach nation of local name {
	reg x y if country==`nation'
	matrix m_`nation'=e(V)
}


HTH,
Jesper

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
sharoncatherine
Sent: 10 October 2011 12:38
To: [email protected]
Subject: st: Problem returning the e(V) covariance matrix for looped
regression

Dear Stata users,

I have StataSE 11 for Windows. I have sorted my data by country of
origin
and I ran an OLS regression *by* country. I now need to get the
covariance
matrix for each country, however, when I enter the command matrix list
e(V)
it only returns the most recently run regression which in this instance
is
the last country in the list. I would really appreciate if someone could
guide me as to how to get the covariance matrix for each country run.

Any help would be greatly appreciated!!

Sharon

--
View this message in context:
http://statalist.1588530.n2.nabble.com/Problem-returning-the-e-V-covaria
nce-matrix-for-looped-regression-tp6876456p6876456.html
Sent from the Statalist mailing list archive at Nabble.com.
*
*   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/

*
*   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