[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
"Michael I. Lichter" <MLichter@Buffalo.EDU> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Analyzing a subpopulation in Stata 10.1 |

Date |
Sat, 27 Jun 2009 16:25:50 -0400 |

Michael ----------------------------------------------------------------------------------------- clear set obs 200 set seed 06272009 gen byte femV1 = _n <= 110 // pop, 55% female gen byte everV1 = (uniform() < .55) if (femV1==1) // females only clonevar everV2 = everV1 replace everV2 = . if (uniform() < .15) // add missing values gen byte native = (uniform() <= .5) // about 50% native in sample label define Lyes01 0 "0-No" 1 "1-Yes" label val femV1 native everV1 everV2 Lyes01 gen postwt = cond(native, 3000, 1000) // 75% native in population svyset, poststrata(native) postweight(postwt) svy: tab femV1, count format(%10.0f) obs // [T1] femV1 only svy: tab everV2, count format(%10.0f) obs // [T2] ever2 only

----------------------------------------------------------------------------------------- . svy: tab femV1, count format(%10.0f) obs // [T1] femV1 only (running tabulate on estimation sample)

---------------------------------- femV1 | count obs ----------+----------------------- 0-No | 1626 90 1-Yes | 2374 110 | Total | 4000 200 ---------------------------------- Key: count = counts obs = number of observations . svy: tab everV2, count format(%10.0f) obs // [T2] everV2 only (running tabulate on estimation sample)

---------------------------------- everV2 | count obs ----------+----------------------- 0-No | 1821 44 1-Yes | 2179 50 | Total | 4000 94 ---------------------------------- Key: count = counts obs = number of observations

(running tabulate on estimation sample)

---------------------------------- everV2 | count obs ----------+----------------------- 0-No | 1009 44 1-Yes | 1242 50 | Total | 2251 94 ---------------------------------- Key: count = counts obs = number of observations

(running tabulate on estimation sample)

---------------------------------- everV2 | count obs ----------+----------------------- 0-No | 946 44 1-Yes | 1168 50 . | 260 16 | Total | 2374 110 ---------------------------------- Key: count = counts obs = number of observations ----------------------------------------------------------------------------------------- -- Michael I. Lichter, Ph.D. <mlichter@buffalo.edu> Research Assistant Professor & NRSA Fellow UB Department of Family Medicine / Primary Care Research Institute UB Clinical Center, 462 Grider Street, Buffalo, NY 14215 Office: CC 126 / Phone: 716-898-4751 / FAX: 716-898-3536 * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**References**:**st: Analyzing a subpopulation in Stata 10.1***From:*"Karadogan, Figen" <fo145502@ohio.edu>

**Re: st: Analyzing a subpopulation in Stata 10.1***From:*Marcello Pagano <pagano@hsph.harvard.edu>

**RE: st: Analyzing a subpopulation in Stata 10.1***From:*"Karadogan, Figen" <fo145502@ohio.edu>

- Prev by Date:
**st: Re: Date: Sat, 27 Jun 2009 12:35:33 -0700** - Next by Date:
**st: RE: RE: R2 stats using statsby or parmby???** - Previous by thread:
**RE: st: Analyzing a subpopulation in Stata 10.1** - Next by thread:
**Re: st: Analyzing a subpopulation in Stata 10.1** - Index(es):

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