Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Majority command: Not producing new varname


From   "Tonya Cropper" <[email protected]>
To   "Statalist" <[email protected]>
Subject   st: Majority command: Not producing new varname
Date   Sun, 25 Apr 2004 11:54:10 -0400

Dear Statalisters,

I am using the majority command (author: Nicholas J. Cox) to count majority
items in a specific group (defid).  However, when I used the option
generate(newvarlist) with one variable to return the majority calculation,
the variable is not generated.  Below is the command I typed and an extract
of the results.  I would like to further manipulate the majority valuable,
but it is not generated from this command.  Any help is appreciated. Thank
you.

majority predelib, pos(1) neg(2) by(defid) gen(maj)

  +------------------------------------------------+
  | defid   total   positive   negative   majority         |
  |------------------------------------------------|
  |     3       5          2          2          0                    |
  |     7       3          2          0          2                    |
  |     9       3          1          0          1                    |
  |    11       4          0          3         -3                  |
  |    13       3          0          1         -1                  |
  |------------------------------------------------|

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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