ard_categorical_ci.survey.design: ARD survey categorical CIs

View source: R/ard_categorical_ci.survey.design.R

ard_categorical_ci.survey.designR Documentation

ARD survey categorical CIs

Description

Confidence intervals for categorical variables calculated via survey::svyciprop().

Usage

## S3 method for class 'survey.design'
ard_categorical_ci(
  data,
  variables,
  by = NULL,
  method = c("logit", "likelihood", "asin", "beta", "mean", "xlogit"),
  conf.level = 0.95,
  value = list(where(is_binary) ~ 1L, where(is.logical) ~ TRUE),
  df = survey::degf(data),
  ...
)

Arguments

data

(survey.design)
a design object often created with survey::svydesign().

variables

(tidy-select)
columns to include in summaries.

by

(tidy-select)
results are calculated for all combinations of the columns specified, including unobserved combinations and unobserved factor levels.

method

(string)
Method passed to survey::svyciprop(method)

conf.level

(numeric)
a scalar in ⁠(0, 1)⁠ indicating the confidence level. Default is 0.95

value

(formula-list-selector)
function will calculate the CIs for all levels of the variables specified. Use this argument to instead request only a single level by summarized. Default is list(where(is_binary) ~ 1L, where(is.logical) ~ TRUE), where columns coded as 0/1 and TRUE/FALSE will summarize the 1 and TRUE levels.

df

(numeric)
denominator degrees of freedom, passed to survey::svyciprop(df). Default is survey::degf(data).

...

arguments passed to survey::svyciprop()

Value

ARD data frame

Examples


data(api, package = "survey")
dclus1 <- survey::svydesign(id = ~dnum, weights = ~pw, data = apiclus1, fpc = ~fpc)

ard_categorical_ci(dclus1, variables = sch.wide)
ard_categorical_ci(dclus1, variables = sch.wide, value = sch.wide ~ "Yes", method = "xlogit")


cardx documentation built on Sept. 11, 2024, 9:12 p.m.