# st: Degrees of freedom formula for -svytab-

 From Roger Newson To statalist@hsphsun2.harvard.edu Subject st: Degrees of freedom formula for -svytab- Date Mon, 25 Oct 2004 15:24:37 +0100

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)

Roger

References

Newson, R. 2003. Confidence intervals and p-values for delivery to the end user. The Stata
http://www.kcl-phs.org.uk/rogernewson.

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 http://www.kcl-phs.org.uk/rogernewson.

--
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: roger.newson@kcl.ac.uk
Website: http://www.kcl-phs.org.uk/rogernewson

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

*
* 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/