analyze_con: Estimation of weighted means of continuous data

View source: R/analyzing.R

analyze_conR Documentation

Estimation of weighted means of continuous data

Description

Given continuous data and the weights for the individual observations, calculate estimated mean and confidence intervals.

Usage

analyze_con(
  data,
  weights,
  id_var,
  value_var,
  wgt_var,
  conf = 80,
  verbose = FALSE
)

Arguments

data

Data frame. Continuous data (e.g., numeric) with the unique identifiers for each observation/row in the variable id_var and the value for each observation/row in value_var. Note that the unique identifiers are the link between data and weights

weights

Data frame. This must contain the weighting information using the variables id_var with a unique identifier for each observation/row and wgt_var with the relative numeric weight of each observation/row.

id_var

Character string. The name of the variable in data and weights that contains the unique identifiers for the observations. All values in data$id_var must appear in weights$id_var.

value_var

Character string. The name of the variable in data that contains the values as character strings.

wgt_var

Character string. The name of the variable in weights that contains the numeric weight values.

conf

Numeric. The confidence level in percent. Defaults to 80.

verbose

Logical. If TRUE then the function will generate additional messages as it executes. Defaults to FALSE.

Value

A data frame containing the count of observations, weighted mean, and confidence intervals.


nstauffer/aim.analysis documentation built on Nov. 20, 2024, 8:38 a.m.