Statalist


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

st: Mata question


From   Christian Bustamante <cdeb77@gmail.com>
To   Statalist <statalist@hsphsun2.harvard.edu>
Subject   st: Mata question
Date   Sat, 4 Jul 2009 02:15:26 -0500

Hi all

I'm trying to do a loot with a nested -ttesti- but I couldn't do it. I
have two vector with different means (m1 and m2) and another two with
each mean's standard deviation (s1 and s2). This vectors are quite
large, so do -ttesti- element for element could be very costly. Also,
I have each sample's size on two variables: n1 and n2. All this values
are obtained from a logistic regresion. After run -ttesti- I want to
save the t-statistic -r(t)- and the probability for two-sided p-value
-r(p)-. I'm doing something like this:

forvalues i=1/size(m1) {    /* how can i get vector's size? */
		ttesti n1 m1[1,`i'] s1[1,`i'] n1 m1[1,`i'] s1[1,`i']
		mat tvalues[1,`i']=r(t)
		mat pvalues[1,`i']=r(p)
	}

But appears a lot of errors: 1) n1 should be integer. 2) 'm1' found
where number expected. 3) varlist not allowed.
How can I solve this?

Thanks



-- 
CdeB
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index