calculate_stats_gamma {simBKMRdata}R Documentation

Calculate summary statistics and gamma parameters for each group

Description

This function computes the sample size, gamma distribution parameters (shape and rate), and Spearman correlation matrix for each group, based on the grouping column.

Usage

calculate_stats_gamma(data_df, group_col, using = c("MoM", "gMLE"))

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.

using

which method will be used to estimate the multivariate Gamma shape and rate parameters. Defaults to "MoM" (method of moments, which was used in the author's paper), or "gMLE" (maximum likelihood estimates from the Generalized Gamma distribution without bias correction).

Value

A list of lists, where each inner list contains:

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_gamma(myData, "GENDER")

[Package simBKMRdata version 0.2.1 Index]