ard_continuous_ci.survey.design: ARD survey continuous CIs

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

ard_continuous_ci.survey.designR Documentation

ARD survey continuous CIs

Description

One-sample confidence intervals for continuous variables' means and medians. Confidence limits are calculated with survey::svymean() and survey::svyquantile().

Usage

## S3 method for class 'survey.design'
ard_continuous_ci(
  data,
  variables,
  by = NULL,
  method = c("svymean", "svymedian.mean", "svymedian.beta", "svymedian.xlogit",
    "svymedian.asin", "svymedian.score"),
  conf.level = 0.95,
  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 for confidence interval calculation. When "svymean", the calculation is computed via survey::svymean(). Otherwise, it is calculated viasurvey::svyquantile(interval.type=method)

conf.level

(scalar numeric)
confidence level for confidence interval. Default is 0.95.

df

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

...

arguments passed to survey::confint()

Value

ARD data frame

Examples


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

ard_continuous_ci(dclus1, variables = api00)
ard_continuous_ci(dclus1, variables = api00, method = "svymedian.xlogit")


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