Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: desmat with the defcon(dev(#)) option seems to misbehave


From   John Hendrickx <[email protected]>
To   Kim Lyngby Mikkelsen <[email protected]>, [email protected]
Subject   st: Re: desmat with the defcon(dev(#)) option seems to misbehave
Date   Wed, 14 Jan 2004 04:34:18 -0800 (PST)

It's a property of the deviation contrast that the constant will be
equal to the unweighted mean of the category means (in a oneway
model). Other programs such as SPSS will give the same values.

Best,
John Hendrickx


--- Kim Lyngby Mikkelsen <[email protected]> wrote:
> Dear Statalisters--
> 
>  
> 
> The constant term reported by �desmat- using the defcon(dev#))
> option
> seems to be wrong. 
> 
>  
> 
> In the example given below, the constant term reported by -desmat-
> is an
> un-weighted mean of the within category means, where I would have
> expected the overall mean to be reported!
> 
>  
> 
> Is this a bug or the intension?
> 
>  
> 
>  
> 
> I am using Stata 8 for Windows updated 15 Dec 2003, and my -desmat-
> is
> up to date:
> 
> . which desmat
> 
> c:\ado\stbplus\d\desmat.ado
> 
> *! version 3.1, 29Oct2002, HYPERLINK
> "mailto:[email protected]"[email protected]
> 
>  
> 
>  
> 
> Example:
> 
> In the following, somewhat silly, example I would like to see if
> one
> category of �education years� (soev1: 3 categories (<8, <11, or
> more))
> have a mean height which differs from the overall mean height:
> 
>  
> 
> The mean height of the sample population is:
> 
> . su height if soev1!=.
> 
>  
> 
> Variable | Obs       Mean     Std. Dev. 
> 
> ---------+-------------------------------
> 
>  height  | 15089     167.933  9.044364   
> 
>  
> 
>  
> 
> And the height by category of educational years is:
> 
> . table  soev1, c(mean  height freq) f(%9.3f) row
> 
>  
> 
> ----------------------------------------
> 
> education |
> 
> , years   | mean(height)           Freq.
> 
> ----------+-----------------------------
> 
>         1 |       165.955          6,687
> 
>         2 |       168.886          6,772
> 
>         3 |       172.089          1,630
> 
>           | 
> 
>     Total |       167.933         15,089
> 
> ----------------------------------------
> 
> (Higher people have more education years (or vice versa)).
> 
>  
> 
>  
> 
>  
> 
> From this table the �wrong� mean (of the within category means) can
> be
> calculated as:
> 
> . di (165.955 + 168.886 + 172.089)/3
> 
> 168.97667
> 
>  
> 
> This �wrong� mean of the within category mean, is the mean which is
> calculated by �desmat-:
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
> . desmat: reg hojharm  soev1, defcon(dev(3))
> 
> ------------------------------------------------
> 
>    regress
> 
> ------------------------------------------------
> 
> Dependent variable                        height
> 
> Number of observations:                    15089
> 
> F statistic:                             388.653
> 
> Model degrees of freedom:                      2
> 
> Residual degrees of freedom:               15086
> 
> R-squared:                                 0.049
> 
> Adjusted R-squared:                        0.049
> 
> Root MSE                                   8.821
> 
> Prob:                                      0.000
> 
> ------------------------------------------------
> 
> nr Effect                      Coeff        s.e.
> 
> ------------------------------------------------
> 
> soev1 
> 
> 1    1                        -3.022**     0.108
> 
> 2    2                        -0.090       0.108
> 
> 3  _cons                     168.977**     0.089
> 
> ------------------------------------------------
> 
> *  p < .05
> 
> ** p < .01
> 
>  
> 
>  
> 
> As can be seen, the constant term reported by �desmat- (_cons =
> 168.977)
> is the �wrong� un-weighted mean calculated above, and not the
> overall
> mean (= 167.933), which I would have expected.
> 
>  
> 
>  
> 
>  
> 
> Regards
> 
> Kim
> 
> MD, Ph.D, Epidemiologist
> 
> Institute of Occupational Health, Denmark
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.547 / Virus Database: 340 - Release Date: 02-12-2003
>  
> 


__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus
*
*   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