Bookmark and Share

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]

st: Assistance regarding a maximum likelihood model


From   "[email protected]" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Assistance regarding a maximum likelihood model
Date   Wed, 14 Sep 2011 01:23:05 +0000

I am completing a study on contributions of volunteer hours in a not-for-profit organisation, factoring in a number of motives and also controls (i.e. time constraints). These hours have been disaggregated into different activities, with potentially different motives for the hours in each).

I am not a statistics genius but I'm trying to get my head around the model. I'm looking at a maximum likelihood model in order to try to predict where someone would sit (in terms of hours contributed).

I'm having some issues with the 'ml search' command. I understand helping the model find initial values would help, but I'm not sure what to look in terms of the initial values (code below for reference).

Any assistance is greatly appreciated, and I can try clarify any questions others have.

Many thanks.
Jeremy

Do-file:

capture program drop mixing3
program mixing3
 version 9.1
 args lj xb1 xb2 xb3 lo1 lo2 ls1 ls2 ls3
 tempvar f1 f2 f3 p p1 p2 p3 s1 s2 s3
 quietly {
  gen double `s1'=exp(`ls1')
  gen double `s2'=exp(`ls2')
  gen double `s3'=exp(`ls3')
  gen double `p'= 1 + exp(`lo1') + exp(`lo2')
  gen double `p1'=1/`p'
  gen double `p2'=exp(`lo1')/`p'
  gen double `p3'=exp(`lo2')/`p'
  gen double `f1' = normden($ML_y1, `xb1', `s1')
  gen double `f2' = normden($ML_y1, `xb2', `s2')
  gen double `f3' = normden($ML_y1, `xb3', `s3')
  replace `lj'=ln(`p1'*`f1' + `p2'*`f2' + `p3'*`f3')
 }
end
ml model lf mixing3 /*
 */(xb1: vol_hrs= x1 x2 x3 x4 x5 x6 ) /* 
 */(xb2: vol_hrs= x1 x2 x3 x4 x5 x6 ) /*
 */(xb3: vol_hrs= x1 x2 x3 x4 x5 x6 ) /* 
 */(lo1: motive1 motive2 motive3 motive4)/*
 */(lo2: motive1 motive2 motive3 motive4)/*
 */(lsd1: ) /*
 */(lsd2: ) /*
 */(lsd3: ) 
ml check
ml search
ml maximize

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index