Statalist


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

RE: st: Re: Generating comparison/contingency tables


From   Tomas M <anon556656@live.ca>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Re: Generating comparison/contingency tables
Date   Mon, 1 Jun 2009 10:09:44 -0700

Hi,

One more question.

I compared the 95% confidence intervals with the tabout command and the -ci- command, but they do not match.  They are off by a few decimal places.  This, accordingly, leads to confidence intervals that are off by a few decimal places as well.

Does anyone know why, or how the confidence intervals are calculated for each command?

Thank you!

Example:

sysuse nlsw88,clear
svyset _n
tabout south coll using table3.txt, replace c(row se ci) f(1 5 3) clab(Row_% 95%_CI)  svy npos(lab) per
by south, sort: ci coll

E.g.
with -tabout-: SE==1.18430, CI=21.834-26.478
with -ci-: SE==1.18449, CI=21.75603-26.40348

----------------------------------------
> Date: Sat, 30 May 2009 21:58:00 -0400
> Subject: Re: st: Re: Generating comparison/contingency tables
> From: sjsamuels@gmail.com
> To: statalist@hsphsun2.harvard.edu
>
> --
> Tomas
>
> I should explain that you can use -tabout- with non-survey data.
> However the command uses a -svy- command internally to generate and
> display standard errors and confidence intervals. Accordingly you
> must still -svyset- your data, but leave it with its non-survey
> characteristics (no weights, PSUs = observations).. The command
> "svyset _n" does that for the data, and the option "svy" in -tabout-
> makes it happen.
>
> -Steve
>
> On Fri, May 29, 2009 at 9:15 PM,  wrote:
>> Weights have nothing to do with it.  Simply -svyset- the data and use
>> the "svy" option
>>
>> *****************************************************
>> sysuse nlsw88,clear
>> svyset _n
>> tabout south race smsa coll using table3.txt, replace ///
>> c(row ci) f(1 1 ) clab(Row_% 95%_CI)  svy ///
>> npos(lab) per
>> ****************************************************
>>
>> -Steve
>>
>> On Fri, May 29, 2009 at 5:38 PM, Martin Weiss  wrote:
>>> <>
>>>
>>> The dataset employed in the pdf is not a survey dataset as such- it is
>>> turned into one on page 29 via
>>>
>>> -gen wt = int(uniform()*10)-
>>>
>>>
>>> and, by implication,
>>>
>>> -svyset wt-
>>>
>>> which sort of tricks Stata into thinking it is dealing with survey data,
>>> although the weights are pure noise.
>>>
>>> I think you could do the same to your data...
>>>
>>>
>>> HTH
>>> Martin
>>> _______________________
>>> ----- Original Message ----- From: "Tomas M" 
>>> To: 
>>> Sent: Friday, May 29, 2009 9:43 PM
>>> Subject: st: Generating comparison/contingency tables
>>>
>>>
>>>> Hello Statalisters,
>>>>
>>>> Essentially, I want to create a comparison table, comparing a set of
>>>> categorical predictor variables between outcome variables.  I specifically
>>>> want the Row %, with the 95% CI.
>>>>
>>>> The exact table I want can be found at:
>>>> http://www.ianwatson.com.au/stata/tabout_tutorial.pdf, page 20.  This
>>>> -tabout- command would be perfect, except that it requires survey data for
>>>> that given example.
>>>>
>>>>
>>>> I want:
>>>>
>>>> --------------.......Outcome 1.......Outcome 2.......Outcome 3.....--
>>>> ---Predictor 1.....Row %, 95% CI...Row %, 95% CI...Row %, 95% CI...--
>>>> ---Predictor 2.....Row %, 95% CI...Row %, 95% CI...Row %, 95% CI...--
>>>> ---Predictor 3.....Row %, 95% CI...Row %, 95% CI...Row %, 95% CI...--
>>>> ---Predictor 4.....Row %, 95% CI...Row %, 95% CI...Row %, 95% CI...--
>>>> ---Predictor 5.....Row %, 95% CI...Row %, 95% CI...Row %, 95% CI...--
>>>> ---Predictor 6.....Row %, 95% CI...Row %, 95% CI...Row %, 95% CI...--
>>>>
>>>> Does anyone know how to do this with Stata?
>>>>
>>>> I have tried estpost (but no -by- option with CI), fsum (but this switches
>>>> around the rows and columns), tabstat (which allows me to switch rows and
>>>> columns to my preferred orientation, but there no CI option).
>>>>
>>>> I would appreciate any help at all!
>>>>
>
> *
> * 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/

_________________________________________________________________
Internet explorer 8 lets you browse the web faster.
http://go.microsoft.com/?linkid=9655582
*
*   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/



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