Learn R Programming

nonprobsampling (version 0.1.0)

naive_mean: Compute naive (unweighted) means from the convenience sample

Description

Filters the convenience sample to complete cases, then computes the unweighted sample mean (and its variance) for each domain using `naive_mean_one_domain()`. The domain structure is standardized via `standardize_zcol()`.

Usage

naive_mean(df, domain_var = NULL, y)

Value

A list with components:

- `type`: `"single"` for overall or binary domains; `"multi"` for factor/character domains. - `labels`: character vector of domain labels. - `estimates`: for `type = "single"`, a list with `mean` and `variance`. For `type = "multi"`, a list of such lists, one per domain level.

Arguments

df

A data frame containing the convenience sample (typically `build$internal$raw_sc`).

domain_var

Single character string naming the domain variable in `df`, or NULL for the overall mean.

y

Single character string naming the outcome variable in `df`.