[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

From |
"Svend Juul" <SJ@SOCI.AU.DK> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
RE: st: Question dealing with Missing Values and Tabulating |

Date |
Thu, 26 May 2005 19:44:49 +0200 |

Ashish has two questions about missing values and about tabulating data. In general missing values are omitted from tabulations and calculation of percentages, so you need not drop observations with missing values. If you on the contrary want the see the missing category, use the -missing- options, as in: tab1 content2 , missing I do have doubts about the way you use -encode- because you don't control which numeric codes are assigned to which text strings. Text strings are sorted alphabetically and given the numeric codes 1,2,3 - unless you define value labels corresponding exactly to the text strings AND inform -encode- about which labels to use. So the commands you gave could be: label define agree 1 "Strongly agree" 2 "Agree" 3 "Neither agree nor disagree" 4 "Disagree" 5 "Strongly disagree" encode lessoncontent~o, gen(content) label(agree) recode content (1 2 = 2) (4 5 = 4), gen(content2) label values content2 agree tab1 content2 encode detailprovide~p, gen(detail) label(agree) recode detail (1 2 = 2) (4 5 = 4), gen(detail2) label values detail2 agree tab1 detail2 encode thelevelofdif~s, gen(difficulty) label(agree) recode difficulty (1 2 = 2) (4 5 = 4), gen(difficulty2) label values difficulty2 agree tab1 difficulty2 Note that the label agree is common to all three variables, so you only need define it once. The label() option to encode defines the codes generated, provided the labels correspond exactly to the original text strings. Although they are variations to -tabulate- I prefer -tab1- for one-variable tables and -tab2- for two-variable tables (as you will see shortly). Including horizontal percentages in a two-variable tabulation should be simple: tab2 status haveyoureceiv~t , row If you want to display missing categories it is: tab2 status haveyoureceiv~t , row missing To help yourself you could have studied in more detail the manual entries (Stata 8): [R] tabulate [R] encode [R] label Hope this helps Svend ________________________________________________________ Svend Juul Institut for Folkesundhed, Afdeling for Epidemiologi (Institute of Public Health, Department of Epidemiology) Vennelyst Boulevard 6 DK-8000 Aarhus C, Denmark Phone, work: +45 8942 6090 Phone, home: +45 8693 7796 Fax: +45 8613 1580 E-mail: sj@soci.au.dk _________________________________________________________ * * For searches and help try: * http://www.stata.com/support/faqs/res/findit.html * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

- Prev by Date:
**st: Bar chart and time series** - Next by Date:
**st: RE: supertables, please. (Tufte 1983 :179)** - Previous by thread:
**st: Question dealing with Missing Values and Tabulating** - Next by thread:
**st: Date: Thu, 26 May 2005 17:36:52 +0200** - Index(es):

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