Learn R Programming

trendtestR (version 1.0.1)

prepare_group_data: Prepare Grouped Data for Statistical Testing

Description

This function prepares a dataset for grouped statistical tests by: - Filtering out NA values in the target variable; - Dropping empty groups and reporting excluded levels; - Splitting the values by group and computing sample sizes.

Diese Funktion bereitet Daten fuer gruppierte Tests vor: - Entfernt fehlende Werte (NA) in der Zielvariablen; - Entfernt leere Gruppen und gibt eine Warnung aus; - Teilt die Werte nach Gruppen und berechnet Stichprobengroessen.

Usage

prepare_group_data(df, value_col = ".value", group_col = "jahr")

Value

A list with the following elements:

df

The filtered data frame with updated grouping column.

vals

A list of vectors, one per group, containing values.

sample_sizes

A named vector with sample sizes per group.

n_groups

The number of groups remaining after filtering.

group_names

The names of the groups.

Arguments

df

A data.frame or tibble containing the data.

value_col

A string indicating the name of the column with values to test.

group_col

A string indicating the name of the grouping column.

Details

Cleans and splits the input data by group, removing missing values and empty groups.