------------------------------------------------------------------------------- help for_mrsvmat-------------------------------------------------------------------------------

Post-mrtabutility

_mrsvmat[,stat(statname)rtotalctotalnopercentnolabelclear]where

statnameis {freq|column|row|cell|rcolumn|rcell}

Description

_mrsvmatcan be used after mrtab to create a data matrix from the results left behind (note that the data in memory will be lost). Do not use_mrsvmatunless you are confident that mrgraph does not meet your needs.Each row of the data created by

_mrsvmatwill represent one response category. The variables are:R Values/names of the response categories.

L Labels of the response categories (if available).

C1, C2, ... Frequencies. Each variable represents one column of the two-way frequency table. In the case of one-way tables, just one variable, C1, will be created.

T Row totals (optionally).

Options

clearallows_mrsvmatto clear the data in memory without asking for confirmation.

ctotalspecifies that column totals be saved.

nolabelspecifies that labels be ignored.

nopercentspecifies that relative frequencies be formatted as proportions (.271) rather than percentages (27.1).

rtotalspecifies that row totals be saved.

stat(statname)determines the statistic to be saved.statnameis eitherfreqfor raw frequencies orcolumn(base: column total of observations),row(base: row total),cell(base: grand total of valid observations),rcolumn(base: column total of responses), orrcell(base: grand total of responses) for relative frequencies.stat(freq)is the default.

Example. use http://fmwww.bc.edu/RePEc/bocode/d/drugs.dta (1997 Survey Data on Swiss Drug Addicts)

. mrtab crime1-crime5, include response(2 3) by(sex) nofreq . preserve . _mrsvmat, stat(column) ctotal rtotal clear . list, clean string(20) R L C1 C2 T > 1. crime1 hit someone 14.46281 14.15663 14.23841 > 2. crime2 use a weapon against.. 1.652893 3.313253 2.869757 > 3. crime3 sexual harassment, r.. 12.80992 0 3.421633 > 4. crime4 robbery (including d.. 13.22314 9.939759 10.81678 > 5. crime5 blackmail 5.785124 2.108434 3.090508 > 6. T Total 47.93388 29.51807 34.43708 >

. generate x=_n . scatter C1 C2 x in 1/5, xtitle(Type of crime) ytitle(Percent) title(Criminal experiences (as a victim))

AuthorBen Jann, ETH Zurich, jann@soz.gess.ethz.ch

Also seeManual:

[P] matrix mkmat