Statalist


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

st: two-sample vs. two-mean


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: two-sample vs. two-mean
Date   Tue, 8 Apr 2008 15:14:04 +0200

Dear Statalisters,


Try this in Stata:

**********
webuse fuel, clear
qui{
*two-sample mean comparison
noi ttest mpg1==mpg2
local pl1=r(p_l) 
local pu1=r(p_u)
local p1=r(p)

*two-group mean comparison
stack mpg1 mpg2, into(mpg)  clear
rename _s group
noi ttest mpg, by(group)
local pl2=r(p_l) 
local pu2=r(p_u)
local p2=r(p)

*Results
noi di  _newline
noi di in red "Results:" _newline
noi di in red "Test against H1: <" _column(23)  round(`pl1', .001) " versus
" round(`pl2', .001) _newline 
noi di in red "Test against H1: >" _column(23)  round(`pu1', .001) " versus
" round(`pu2', .001) _newline
noi di in red "Test against H1: !=" _column(23) round(`p1', .001) " versus "
round(`p2', .001) _newline
}
**********

Then let me know how I can easily explain the difference between a
"two-sample mean" and a "two-group mean" comparison test.

Warm regards,
Martin Weiss
_________________________________________________________________

Diplom-Kaufmann Martin Weiss
Mohlstrasse 36
Room 415
72074 Tuebingen
Germany

Fon: 0049-7071-2978184

Home: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1130

Publications: http://www.wiwi.uni-tuebingen.de/cms/index.php?id=1131

SSRN: http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=669945



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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