[Limdep Nlogit List] Nlogit Error 352: Model with Panel. Sum of T(i) not equal to full sample size

William Greene wgreene at stern.nyu.edu
Wed Dec 9 01:46:06 AEDT 2020


Akram Ahmad.  When you use the NLOGIT estimator with stated choice data, it
is necessary
to indicate how many choice tasks there are, with the ;PDS specification,
as you have done.
The data set resembles a panel.  However, using NLOGIT, rather than, say,
REGRESS, the
panel looks a bit different.  Your observation consists of 8 tasks and 3
rows of data (alternatives)
per task.  It seems like the panel should contain 24 rows per task.  But,
your PDS correctly
specifies PDS = 8.  NLOGIT resolves this as follows:  There are two passes
through the data
to set up the model using panel, SP data.  The first pass is generic,
before the program "knows" that
you will be fitting a choice model.  If you specified PDS=8 at this point,
it looks like a mismatch
unless you happen to have number of observations equal to a multiple of 8,
which may or may
not be true.  If not, the diagnostic occurs.  At this point, the program
takes the next step and
assembles the structure of the data for the choice experiment, which has 8
tasks per chooser
and 3 alts per task.  The match of the PDS to the data, with this revised
form, is checked.  If you
have correctly provided 8 sets of 3 rows of data, this second check will
pass, and your results
will follow.  The upshot is that you can ignore the error 352.
Regards
Bill Greene


On Tue, Dec 8, 2020 at 2:47 AM Akram Ahmad via Limdep <
limdep at mailman.sydney.edu.au> wrote:

> Hi everybody,
>
> I have a question regarding Mixed logit model. For my research I want to
> investigate patients' preferences for conventional or Ayurvedic medicines
> for the treatment of diabetes and investigate what factors could affect
> patients' preferences.
>
> In a labelled d-efficient design, which will have 3 alternatives where the
> last alternative would be a no-choice alternative. There were 8 attributes
> (7 of them have 3 levels and 1 attribute has 2 levels). We will be giving 8
> choice tasks to each participant and block the design into 4 versions (for
> 32 tasks). Negative signs in the values indicate that the particular
> attribute will negatively contribute to the utilisation of the given
> alternative. For example, side-effects will decrease the utility of the
> medication (both conventional and alternative).
> Here is my syntax for your perusal. The syntax error is popping up [Error
>   352: Model with Panel. Sum of T(i) not equal to full sample size]
> Any help would be appreciated.
>
> Mixed logit model
>
> NLOGIT
> ;lhs=choice,cset,altij
> ;choices=CM,AM,NEITHER
> ;rpl
>
> ;fcn=effec(n),sidef(n),dosage(n),formu(n),instruct(n),hypo(n),weight(n),cost(n)
> ;pts=500 ;halton
> ;pds=nchoice
> ;model:
> U(cm)=cm+effec1*effec1+ effec2*effec2+
> sidef1*sidef1+sidef2*sidef2+dosage1*dosage1+
> dosage2*dosage2+formu1*formu1+formu2*formu2+instruct*instruct+hypo1*hypo1+hypo2*hypo2+weight1*weight1+weight2*weight2+cost1*cost1+cost2*cost2/
> U(am)=am+effec1*effec1+ effec2*effec2+
> sidef1*sidef1+sidef2*sidef2+dosage1*dosage1+
> dosage2*dosage2+formu1*formu1+formu2*formu2+instruct*instruct+hypo1*hypo1+hypo2*hypo2+weight1*weight1+weight2*weight2+cost1*cost1+cost2*cost2/
> U(neither)=0
> $
>
> Regards,
> Akram Ahmad
> PhD student at School of Pharmacy, the University of Sydney.
> _______________________________________________
> Limdep site list
> Limdep at mailman.sydney.edu.au
> https://protect-au.mimecast.com/s/IrBbCD1vlpTzP1lwFWNFhF?domain=limdep.itls.usyd.edu.au
>
>

-- 
William Greene
Department of Economics, emeritus
Stern School of Business, New York University
44 West 4 St.
New York, NY, 10012
URL: https://protect-au.mimecast.com/s/7XKJCE8wmrt2Pm5OCwIVK3?domain=people.stern.nyu.edu
Email: wgreene at stern.nyu.edu
Editor in Chief: Journal of Productivity Analysis
<https://protect-au.mimecast.com/s/K16YCGv0oyCRgm5EFpnwuj?domain=springer.com>
<https://protect-au.mimecast.com/s/K16YCGv0oyCRgm5EFpnwuj?domain=springer.com>
Editor in Chief: Foundations and Trends in Econometrics
Associate Editor: Economics Letters
Associate Editor: Journal of Business and Economic Statistics


More information about the Limdep mailing list