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

Re: st: codebook with percentages

From   "Paul Bern" <[email protected]>
To   <[email protected]>, <[email protected]>
Subject   Re: st: codebook with percentages
Date   Wed, 26 Jan 2005 13:49:09 -0500


The -codebook2- command may have what you want -or at least close to
it.  You'll also need -vartyp- to go along with it.


Paul H. Bern, Ph.D.
Numeric Data Services Librarian         The only thing worse than not
352 Bird Library                                       getting what you
222 Waverly Ave.                                    is getting what you
asked for.
Syracuse, NY 13244

>>> [email protected] 1/11/2005 10:03:51 AM >>>
I am trying to write a codebook, containing the variable name,
label and the frequency, percent, percent of nonmissing values, value,
label of each value.

I would like to have something like this:

q1 state of economy
Value Label Frequency Percent Per(nonm) Cum
1 gotten better 117 6.46% 6.90% 6.46%
2 stayed the same 472 26.08% 27.83% 32.54%
3 gotten worse 1107 61.16% 65.27% 93.70%
. 114 6.30% 100.00%
  1810 100.00% 100.00%

I've tried the commands codebook- and -cb2html-, but codebook- only 
displays value, label and frequency and -cb2html- additionally displays

percentages, but not the percentage of nonmissings and cumulative 
percentages. Ideally I would like to have displayed the percentages of
"valid" categories, where "valid" could be defined as(say) q*<90.

I could get these by using tab- for all variables and copy it, but I
wondering if there is a way to do this automatically.

Any help is greatly appreciated.


*   For searches and help try:
*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index