get_sufficient_category_statistics: Get sufficient statistics from a data set

View source: R/basics.R

get_sufficient_category_statisticsR Documentation

Get sufficient statistics from a data set

Description

Get sufficient statistics from data. Calculates functions for the specified cues for any combination of groups (optional) and categories, and returns them as a tibble. Rows with missing values for cues will be ignored in the calculation of the sufficient statistics.

Usage

get_sufficient_category_statistics(
  data,
  cues,
  category = "category",
  group = NULL,
  categories = NULL,
  groups = NULL,
  ...
)

Arguments

data

'tibble' or 'data.frame' with the data. Each row should be an observation of a category, and contain information about the category label, the cue values of the observation, and optionally grouping variables.

cues

Names of columns with cue values.

category

Name of column that contains the category label for the exposure data. Can be 'NULL' for unsupervised updating (not yet implemented). (default: "category")

group

Name of column(s) that contains information about which observations form a group. This could be individual subjects or conditions in an experiment. The latter is more efficient, but should only be used if exposure is identical for every individual within the group. Test does not have to be identical for every individual within the same group. For example, one can group multiple groups of subjects that have received the same exposure but were tested on different test tokens. If 'NULL' no grouping variable will be considered. (default: 'NULL')

categories, groups

Character vector of categories/groups to be summarize. If 'NULL', all categories/groups will be included. (default: 'NULL')

test

'tibble' or 'data.frame' with the test data. Each row should be an observation, and contain information about the cue values of the test stimulus and the participant's response.

Value

A tibble of sufficient statistics for each combination of category and group. This includes the count, mean, uncentered and centered sums-of-squares and the covariance matrix (or, for univariate, stimuli: the standard deviation).


hlplab/MVBeliefUpdatr documentation built on March 29, 2025, 10:42 p.m.