help groupdata
-------------------------------------------------------------------------------

Title

groupdata -- Prepares data for grouped conditional logit regression

Syntax

groupdata varlist , dep(depvar) groupid(groupid) choiceid(choiceid)

where: groupid is a unique group identifier choiceid is a unique choice identifier

Description

groupdata converts the data set in memory to a new data set that can be used with commands that deal with multinomial type data such as grouped conditional logit multin and dirichlet-multinomial regression dirmul. The dataset in memory must be in the format required by the command clogit. Suppose you have a data set in the format required by clogit:

y x1 x2 gid cid 0 0 4 1 1 0 1 4 1 2 1 1 6 1 3 1 2 2 2 1 0 1 4 2 2 0 3 5 2 3 0 0 4 3 1 1 1 4 3 2 0 1 6 3 3 0 2 6 4 1 1 3 7 4 2 0 2 5 4 3 0 1 5 4 4 1 2 2 5 1 0 1 4 5 2 0 3 5 5 3

After issuing the command

. groupdata x1 x2, dep(y) groupid(gid) choiceid(cid)

your data will look like

x1 x2 gid cid y 0 4 1 1 0 1 4 1 2 1 1 6 1 3 1 2 2 2 1 2 1 4 2 2 0 3 5 2 3 0 2 6 4 1 0 3 7 4 2 1 2 5 4 3 0 1 5 4 4 0

Examples

. groupdata age gender, dep(y) gr(id) ch(choice)

Author

Paulo Guimaraes, Division of Research, University of South Carolina. Email: guimaraes@moore.sc.edu

Also See