check_cluster_id: check_cluster_id() checks if cluster id variable is unique a...

View source: R/check_cluster_id.R

check_cluster_idR Documentation

check_cluster_id() checks if cluster id variable is unique a cross other nested variables. It was designed to assess if schools id are unique countries, and if strata id are unique across countries and regions.

Description

check_cluster_id() checks if cluster id variable is unique a cross other nested variables. It was designed to assess if schools id are unique countries, and if strata id are unique across countries and regions.

Usage

check_cluster_id(data, cluster_1, cluster_2)

Arguments

data

a data frame with nested observations

cluster_1

the cluster id one's wants to check over a hierachical cluster (i.e. schools within countries)

cluster_2

the cluster id which contains the checked cluster (i.e. countries that contains schools)

Value

a logical message

Examples



data_example %>%
check_cluster_id(
  cluster_1 = 'schools',
  cluster_2 = 'country')


dacarras/r4sda documentation built on Nov. 9, 2023, 10:17 a.m.