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

st: codebook with percentages

From   Thomas Gschwend <[email protected]>
To   [email protected]
Subject   st: codebook with percentages
Date   Tue, 11 Jan 2005 16:03:51 +0100

I am trying to write a codebook, containing the variable name, variable
label and the frequency, percent, percent of nonmissing values, value, and
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 all "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 was
wondering if there is a way to do this automatically.

Any help is greatly appreciated.


* For searches and help try:

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