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

st: two-sample vs. two-mean

From   "Martin Weiss" <>
To   <>
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
*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)

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

Fon: 0049-7071-2978184




*   For searches and help try:

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