calculate_stats_gaussian: Calculate summary statistics for each group

View source: R/GroupGaussianParameters.R

calculate_stats_gaussianR Documentation

Calculate summary statistics for each group

Description

This function computes the sample size, mean vector, standard deviation vector, Spearman correlation matrix, and skewness vector for each group, based on the grouping column.

Usage

calculate_stats_gaussian(data_df, group_col)

Arguments

data_df

A data frame containing the data to be processed.

group_col

A character string specifying the name of the column to group by.

Value

A list of lists, where each inner list contains the following parameter estimates for one group:

  • sample size (sampSize)

  • sample mean vector (xBar)

  • sample standard deviation vector (sampSD)

  • sample Spearman correlation matrix (sampCorr_mat)

  • sample skewness (sampSkew)

Examples

myData <- data.frame(
  GENDER = c('Male', 'Female', 'Male', 'Female', 'Male', 'Female'),
  VALUE1 = c(1.2, 2.3, 1.5, 2.7, 1.35, 2.5),
  VALUE2 = c(3.4, 4.5, 3.8, 4.2, 3.6, 4.35)
)
calculate_stats_gaussian(myData, "GENDER")

simBKMRdata documentation built on Sept. 14, 2026, 1:07 a.m.