Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: component order for fmm


From   Scott Merryman <scott.merryman@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: component order for fmm
Date   Tue, 21 Aug 2012 07:24:51 -0500

Why does the order of the components matter?  Also, you should mention
that Partha Deb's -fmm- and Joerg Luedicke's -fmmlc-  are from ssc.

One way would be to change the initial values.  For example:

clear
set seed 891234
set obs 3
gen id = _n
expand 100
gen y = rnormal(50,10) if id == 1
replace y = rnormal(100,10) if id == 2
replace y = rnormal(150,10) if id == 3
fmm y , components(3) mix(normal) from(50 100 150 1 1 1 1 1)
fmm y , components(3) mix(normal) from(50 150 100 1 1 1 1 1)
fmm y , components(3) mix(normal) from(150 100 50 1 1 1 1 1)

Scott


On Mon, Aug 20, 2012 at 7:15 PM, yannan shen <yannan2010@gmail.com> wrote:
> Hi all,
> I am working on some panel data (stocks by month)
> Every year, I am using the fmm package to identify stocks return into
> groups. And then I am using the fmmlc, savec savep command to save up
> the result.
> My code looks like this
>
> keep if  obs==67  *obs 67 =06/1998
> fmm  ro_cons, components(2) mix(normal)
> fmmlc, savec savep
> fmm  ro_cons, components(3) mix(normal)
> fmmlc, savec savep
>
> what I care is _b[_cons] the coefficient for the intercept.
> However, I noticed that for some years _b[_cons group1]>_b[_cons
> group2], and sometimes, it's the other way around.
> It there anyway I can put a constraint to this command and make sure
> the intercept term for group 1 is always greater than intercept for
> group2?
*
*   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   |   Site index