Learn R Programming

surveytable (version 0.9.6)

svyciprop_adjusted: Confidence intervals for proportions, adjusted for degrees of freedom

Description

A version of survey::svyciprop() that adjusts for the degrees of freedom when method = "beta".

Usage

svyciprop_adjusted(
  formula,
  design,
  method = c("logit", "likelihood", "asin", "beta", "mean", "xlogit"),
  level = 0.95,
  df_method,
  ...
)

Value

The point estimate of the proportion, with the confidence interval as an attribute.

Arguments

formula

see survey::svyciprop().

design

see survey::svyciprop().

method

see survey::svyciprop().

level

see survey::svyciprop().

df_method

how df should be calculated: "default" or "NHIS".

...

see survey::svyciprop().

Details

Written by Makram Talih in 2019.

df_method: for "default", df = degf(design); for "NHIS", df = nrow(design) - 1.

To use this adjustment in surveytable tabulations, call set_survey() or set_opts() with the mode = "NCHS" argument, or type: options(surveytable.adjust_svyciprop = TRUE). NHIS users, be sure to set the surveytable.adjust_svyciprop.df_method option to "NHIS".

Examples

Run this code
set_survey(namcs2019sv)
set_opts(mode = "NCHS")
tab("AGER")
set_opts(mode = "general")

Run the code above in your browser using DataLab