act_svyciprop_tbl: Similar to act_svyciprop, but able to spit out a dataframe...

View source: R/act_svyciprop_tbl.R

act_svyciprop_tblR Documentation

Similar to act_svyciprop, but able to spit out a dataframe containing estimates for multiple variables/responses. Variables and responses are input as vectors.

Description

Similar to act_svyciprop, but able to spit out a dataframe containing estimates for multiple variables/responses. Variables and responses are input as vectors.

Usage

act_svyciprop_tbl(variable_vect_name, response, design_obj, ...)

Arguments

variable_vect_name

a vector of variables of interest (in quotes)

response

a vector of response of intersest for each entry in varibale_vect_name. Note that these are paired by order and that the number of entries in variable_vect_name and response must be equal

...

arguments passed to svyciprop

design

svydesign object containing the variables/values. Can only take one svydesign. To call multiple svydesigns in parallel, see purrr package or Rtesunate::act_svyciprop_list()

Value

A mutli-row dataframe providing the variable names, weighted mean proportions of observations taking value of interest, cluster-adjusted 95% CIs, and counts as n/N character variable (N is all non-NA values).

Examples

using api data from survey package
data(api)
design <- svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat, fpc=~fpc)
variable_vect_name <- c("cname", "sch.wide", "awards")
response <- c("Los Angeles", "Yes", "Yes")
act_svyciprop_tbl(variable_vect_name, response, design)


deansayre/Rtesunate documentation built on July 25, 2024, 7:22 p.m.