Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Matrix query


From   Bob Fitzgerald <[email protected]>
To   [email protected]
Subject   st: Matrix query
Date   Thu, 04 Sep 2008 11:23:56 -0700

I have the following code which does not work and I'm stumped. Suggestions welcome.
Female is a dummy variable coded 0=male, 1=female.

****

levelsof female, local(name);
foreach l of local name {;

di "`: label (female) `l''";
ttest sri_lexile_scores_1 = sri_last_lexile_score if female==`l' & filter2==1;
mat b`l' = r(mu_1), r(mu_2), r(N_1), r(N_2), r(t) ,r(p);
matrix list b`l';
};

matrix filter2= b0\b1\;
matrix colnames filter2 = mean1st meanlast nfirst nlast t prob;
matrix list filter2;
mat2txt , matrix(filter2) saving(table 12rev paired ttests filter2 for excel.txt) append;
*****
The program runs the ttests, shows the contents of matrices b0 and b1 at each step through the foreach loop, but fails with the following error message:

. matrix filter2= b0\b1\;
b1\ not found
r(111);

yet b1 is created and the contents reflect the results of the ttest.

Thanks for any advice.

BOb

--
Robert Fitzgerald
Senior Research Associate
MPR Associates, Inc.
2150 Shattuck Ave. #800
Berkeley,CA 94702
(510) 849-4942

www.mprinc.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/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index