EconPapers    
Economics at your fingertips  
 

INLIST2: Stata module to create an inlist() dummy, without the inlist() limitations

Matteo Pinna ()

Statistical Software Components from Boston College Department of Economics

Abstract: inlist2 generates a dummy equal to 1 if varname is equal to the arguments in values(). inlist2 provides a faster way to create multiple "or" statements similarly to inlist, by creating a dummy variable named inlist2 to be used in following step. Inlist2 string values do not require quotation marks (e.g. in case of spaces between parts of the string) so they are faster to write, also, inlist2 does not have a 10 arguments limit for strings or a 250 limit for reals. inlist2 automatically distinguish if the variable is a real or a string, but doesn't allow for commas in string values. Inlist2 does not give error massages if the variable doesn't have one of the values in the list, but one can check replacement is working correctly in the output. Sample conditions (if,in); defines the inlist dummy as a byte and sets it equal to zero when conditions are not satisfied; sets to quiet the replace commands (unless verbose option is on); optimises the dummy creation and sets a default var label.

Language: Stata
Requires: Stata version 12.1
Keywords: data management; programming (search for similar items in EconPapers)
Date: 2021-03-06, Revised 2022-11-24
Note: This module should be installed from within Stata by typing "ssc install inlist2". The module is made available under terms of the GPL v3 (https://www.gnu.org/licenses/gpl-3.0.txt). Windows users should not attempt to download these files with a web browser.
References: Add references at CitEc
Citations:

Downloads: (external link)
http://fmwww.bc.edu/repec/bocode/i/inlist2.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/i/inlist2.sthlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/i/inlist2_example.do sample do-file (text/plain)

Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.

Export reference: BibTeX RIS (EndNote, ProCite, RefMan) HTML/Text

Persistent link: https://EconPapers.repec.org/RePEc:boc:bocode:s458920

Ordering information: This software item can be ordered from
http://repec.org/docs/ssc.php

Access Statistics for this software item

More software in Statistical Software Components from Boston College Department of Economics Boston College, 140 Commonwealth Avenue, Chestnut Hill MA 02467 USA. Contact information at EDIRC.
Bibliographic data for series maintained by Christopher F Baum ().

 
Page updated 2025-03-30
Handle: RePEc:boc:bocode:s458920