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

Re: st: Degrees of freedom formula for -svytab-

From   Nick Winter <[email protected]>
To   [email protected]
Subject   Re: st: Degrees of freedom formula for -svytab-
Date   Mon, 25 Oct 2004 11:54:47 -0400

It looks to me like the -svy- commands do, in fact, return the df in e(df_r).

This df is, in fact, e(N_psu) - e(N_strata).  But you can just grab e(df_r).

--Nick Winter

At 03:24 PM 10/25/2004 +0100, you wrote:
Fellow Statalisters (especially StataCorp):

I have a query about the degrees of freedom used to calculate the confidence intervals for the probabilities/percentages in -svytab-. The confidence interval formula is given near the bottom of Page 85 of -[SVY]-, and includes a symbol, which would be $\nu$ in TeX, for the degrees of freedom of a t-distribution. Near the top of Page 88, $\nu$ is defined as being equal to the number of PSUs minus the number of strata. This seems to imply that, if we use the Stata estimation results for -svytab-, then the degrees of freedom can be calculated by typing

scalar df=e(N_psu)-e(N_strata)

This formula appears to work in at least one example that I have tried in the -auto- data, where I have re-created the confidence intervals produced using the -ci- option of -svytab-. Is this formula always used by -svytab- to calculate confidence intervals?

More generally, are there any other estimation commands (apart from -svytab-, -svymean-, -svyratio- and -svytotal-) which calculate confidence intervals using a t-distribution with degrees of freedom other than those stored in -e(df_r)-? I ask because I am planning to update my -parmest- package (downloadable from SSC) so that the -dof- variable in the resultsset will contain the correct degrees of freedom after the -svytab- command, and would like to know if I should do the same for any other estimation commands. (For more information on -parmest-, see the on-line help for -parmest-, and also Newson (2003) and Newson (2004).) I am aware that -ttest- uses the Satterthwaite or Welch degrees of freedom if the -unequal- option is specified, but -ttest- is not an estimation command, and therefore cannot be used with -parmest-.

I would like to thank Jill Starkes and Lee Sieswerda of Thunder Bay District Health Unit for drawing my attention to the non-standard confidence interval formula used by -svytab-.

Best wishes (and thanks in advance)



Newson, R. 2003. Confidence intervals and p-values for delivery to the end user. The Stata
Journal 3(3): 245-269. Also downloadable from Roger Newson's website at

Newson, R. 2004. From datasets to resultssets in Stata. Presented at the 10th United Kingdom
Stata Users' Group Meeting, London, 29 June, 2004. Also downloadable from Roger Newson's
website at

Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605
Email: [email protected]

Opinions expressed are those of the author, not the institution.

* For searches and help try:
Nicholas Winter 607.255.8819 t
Assistant Professor 607.255.4530 f
Department of Government [email protected] e
308 White Hall w
Cornell University
Ithaca, NY 14853-4601

* For searches and help try:

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