prop_by_weighted: Compute weighted proportion by group for a logical variable

View source: R/strata.R

prop_by_weightedR Documentation

Compute weighted proportion by group for a logical variable

Description

Compute weighted proportion by group for a logical variable

Usage

prop_by_weighted(design, var, by, ci.method = "beta")

Arguments

design

survey design [survey::svydesign()], see [design_weight()]

var

variable on which to compute frequency, must be a logical variable

by

grouping variable name to compute total on

ci.method

method to use to compute adjusted proportion confidence interval

Value

data.frame() with columns

by...

group name of this column is the passed value to the 'by' parameter

n_adj

Count of true values in each group

n_weight

Weight sum of the true value in the group

total_weight

Total weight in the group

total_adj

Total count of non missing value in the group

prop_adj

Adjusted proportion on strata

prop_adj_low

Adjusted proportion lower bound of CI95%

prop_adj_up

Adjusted proportion upper bound of CI95%

variable

Variable name


cturbelin/ifnBase documentation built on Nov. 5, 2023, 12:54 p.m.