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]
Re: st: sqreg -test- at each quantile
From
Maarten buis <[email protected]>
To
[email protected]
Subject
Re: st: sqreg -test- at each quantile
Date
Mon, 21 Mar 2011 08:42:10 +0000 (GMT)
--- On Mon, 21/3/11, Samantha Batchelor wrote:
> I'm running a quantile regression including ethnicity with
> 5 levels as below.
> xi: sqreg vocab i.gender i.mothered i.children i.ethnicity
> standards, q(.2 .4 .6 .8) reps(500)
>
> When I use:
> test _Iethnicity_2 _Iethnicity_3 _Iethnicity_4
> _Iethnicity_5
> to test the effect of ethnicity, Stata tests it across all
> the quantiles whereas I want it separately for each
> quantile.
That is correct. If you do not specify which equation (in case
of -sqreg- which quantile) a variable name belongs to, then
-test- will assume that it has to take all of them. You can
tell -test- which equation to look at by preceding the
parameters with -[eqname]:- where eqname is the name of the
equation. I find it often easier to refer to numbers, i.e.
the first, second, etc. equation with #1, #2, etc.:
*---------------- begin example -----------
sysuse auto, clear
sqreg price weight length foreign, ///
quantile(.25 .5 .75) reps(100)
// using names
test [q25]: weight length
test [q50]: weight length
test [q75]: weight length
// with equation numbers you can
// easily use loops:
forvalues i = 1/3 {
test [#`i']: weight length
}
*---------------- end example -------------
(For more on examples I sent to the Statalist see:
http://www.maartenbuis.nl/example_faq )
Hope this helps,
Maarten
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://www.maartenbuis.nl
--------------------------
*
* 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/