Statalist


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

st: -nlogit-


From   Brendon Gerding <[email protected]>
To   statalist <[email protected]>
Subject   st: -nlogit-
Date   Mon, 3 Aug 2009 12:53:51 +0200

Hi all,

I am having some trouble performing a 2-level -nlogit-.

Here is the segment of code I am having some trouble with:

fillin uniqueNo EmployStatOfficial // Converts response into binary outcome
rename _fillin chosen
replace chosen = 1-chosen // Such that chosen = 1 if the individual
has the corresponding employment status

sort uniqueNo gender
// Filling in missing values (which are present due to use of the
fillin command):
replace gender = gender[_n-1] if gender==.
........
replace gh23a = gh23a[_n-1] if gh23a ==.

nlogitgen type =  EmployStatOfficial(NotEconAct: 3, EconAct: 1 | 2)
nlogittree  EmployStatOfficial type, choice(chosen)

// The following tree is then displayed:
tree structure specified for the nested logit model
 type                N           EmployStat~l       N            k
-----------------------------------------------------
 NotEconAct 1511021 --- Not Econom~e 1511021  775534
 EconAct      3022042 --- Employed        1511021  347228
                                 +- Unemployed    1511021  388259
-----------------------------------------------------
                               total                     4533063   1511021
k = number of times alternative is chosen
N = number of observations at each level

// I then want to perform an -nlogit- using the above structure. I'm
not sure if I need to generate any new variables, or how I should
structure the equation for the regression. The command I've tried was:

nlogit chosen || type: gender (...other variables...) EmpStatHH ||
EmployStatOfficial:, noconstant case(uniqueNo)

I then get the following messages:
note: 1 case (2087331 obs) dropped due to no positive outcome or multiple
       positive outcomes per case
note: branch 1 of level 1 is degenerate and the associated dissimilarity
       parameter ([NotEconAct_tau]_cons) is not defined; see help nlogit for
       details
no equations have been specified to identify the alternatives defined in
variable EmployStatOfficial; see nlogit for the proper syntax
r(198);

I am attempting to perform a logistic regression using certain
parameters at the Economically Active/Not Economically Active stage,
and then another regression using different parameters at the
Unemployed/Employed stage (should the Economically Active branch be
chosen). Please could you help with what I need to change in my nlogit
equation, including how to deal with the degenerate nest. I'm also not
sure if perhaps -clogit- would be more appropriate?

I hope my explanations are clear enough. Any help would be greatly appreciated.

Kind Regards
Brendon Gerding
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index