IDEAS home Printed from https://ideas.repec.org/c/boc/bocode/s455001.html
 

MOREMATA: Stata module (Mata) to provide various functions

Author

Listed:
  • Ben Jann

    (University of Bern)

Programming Language

Stata

Abstract

This package includes various Mata functions. kern(): various kernel functions; kint(): kernel integral functions; kdel0(): canonical bandwidth of kernel; quantile(): quantile function; median(): median; iqrange(): inter-quartile range; ecdf(): cumulative distribution function; relrank(): grade transformation; ranks(): ranks/cumulative frequencies; freq(): compute frequency counts; histogram(): produce histogram data; mgof(): multinomial goodness-of-fit tests; collapse(): summary statistics by subgroups; _collapse(): summary statistics by subgroups; gini(): Gini coefficient; sample(): draw random sample; srswr(): SRS with replacement; srswor(): SRS without replacement; upswr(): UPS with replacement; upswor(): UPS without replacement; bs(): bootstrap estimation; bs2(): bootstrap estimation; bs_report(): report bootstrap results; jk(): jackknife estimation; jk_report(): report jackknife results; subset(): obtain subsets, one at a time; composition(): obtain compositions, one by one; ncompositions(): determine number of compositions; partition(): obtain partitions, one at a time; npartitionss(): determine number of partitions; rsubset(): draw random subset; rcomposition(): draw random composition; greedy(): one-to-one and one-to-many matching; ebal(): entropy balancing (Stata 11 required); colvar(): variance, by column; meancolvar(): mean and variance, by column; variance0(): population variance; meanvariance0(): mean and population variance; mse(): mean squared error; colmse(): mean squared error, by column; sse(): sum of squared errors; colsse(): sum of squared errors, by column; benford(): Benford distribution; cauchy(): cumulative Cauchy-Lorentz dist.; cauchyden(): Cauchy-Lorentz density; cauchytail(): reverse cumulative Cauchy-Lorentz; invcauchy(): inverse cumulative Cauchy-Lorentz; rbinomial(): generate binomial random numbers; cebinomial(): cond. expect. of binomial r.v.; root(): Brent's univariate zero finder; nrroot(): Newton-Raphson zero finder; finvert(): univariate function inverter; integrate_sr(): univariate function integration (Simpson's rule); integrate_38(): univariate function integration (Simpson's 3/8 rule); ipolate(): linear interpolation; polint(): polynomial inter-/extrapolation; sqrt(): square root of a symmetric positive definite matrix; plot(): Draw twoway plot; _plot(): Draw twoway plot; panels(): identify nested panel structure; _panels(): identify panel sizes; npanels(): identify number of panels; nunique(): count number of distinct values; nuniqrows(): count number of unique rows; isconstant(): whether matrix is constant; nobs(): number of observations; colrunsum(): running sum of each column; linbin(): linear binning; fastlinbin(): fast linear binning; exactbin(): exact binning; makegrid(): equally spaced grid points; cut(): categorize data vector; posof(): find element in vector; which(): positions of nonzero elements; locate(): search an ordered vector; hunt(): consecutive search; cond(): matrix conditional operator; expand(): duplicate single rows/columns; _expand(): duplicate rows/columns in place; repeat(): duplicate contents as a whole; _repeat(): duplicate contents in place; unorder2(): stable version of unorder(); jumble2(): stable version of jumble(); _jumble2(): stable version of _jumble(); pieces(): break string into pieces; npieces(): count number of pieces; _npieces(): count number of pieces; regexr(): regular expression replace; invtokens(): reverse of tokens(); realofstr(): convert string into real; strexpand(): expand string argument; matlist(): display a (real) matrix; insheet(): read spreadsheet file; infile(): read free-format file; outsheet(): write spreadsheet file; callf(): pass optional args to function; callf_setup(): setup for mm_callf().

Suggested Citation

  • Ben Jann, 2005. "MOREMATA: Stata module (Mata) to provide various functions," Statistical Software Components S455001, Boston College Department of Economics, revised 24 Nov 2022.
  • Handle: RePEc:boc:bocode:s455001
    Note: This module should be installed from within Stata by typing "ssc install moremata". 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.
    as

    Download full text from publisher

    File URL: http://fmwww.bc.edu/repec/bocode/m/moremata.zip
    File Function: file archive
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/l/lmoremata.mlib
    File Function: Mata object library
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/l/lmoremata10.mlib
    File Function: Mata object library
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/l/lmoremata11.mlib
    File Function: Mata object library
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/l/lmoremata14.mlib
    File Function: Mata object library
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_sample.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/moremata.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/moremata_source.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/moremata10_source.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/moremata11_source.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/moremata14_source.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_unorder2.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_panels.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_quantile.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_strexpand.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_realofstr.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_posof.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_ipolate.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_invtokens.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_linbin.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_histogram.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_ecdf.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_colrunsum.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_rbinomial.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_insheet.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_cut.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_freq.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_colvar.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_gini.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_nunique.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_bs.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_callf.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_expand.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_finvert.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_greedy.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_jk.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_kern.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_locate.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_nobs.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_nrroot.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_polint.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_root.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_which.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_plot.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_pieces.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_benford.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_isconstant.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_mgof.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_subset.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_cauchy.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_matlist.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_cond.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_collapse.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_integrate.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_regexr.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_sqrt.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_ebal.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_clip.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_ddens.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_density.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_diff.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_group.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_minim.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_prod.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_ranks.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_relrank.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_seq.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_sort.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_hl.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_mloc.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_ls.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_qr.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_areg.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_aqreg.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_hdq.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_version.hlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_ebalance.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_wbal.sthlp
    File Function: help file
    Download Restriction: no

    File URL: http://fmwww.bc.edu/repec/bocode/m/mf_mm_crosswalk.sthlp
    File Function: help file
    Download Restriction: no
    ---><---

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Victor Chernozhukov & Wooyoung Kim & Sokbae Lee & Adam M. Rosen, 2015. "Implementing intersection bounds in Stata," Stata Journal, StataCorp LP, vol. 15(1), pages 21-44, March.

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:boc:bocode:s455001. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Christopher F Baum (email available below). General contact details of provider: https://edirc.repec.org/data/debocus.html .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.