Skip to contents

Score an Individual Data Frame

Usage

score_individual_df(
  individual_df,
  n_trials,
  n_replicates,
  max_variance,
  variance_set
)

Arguments

individual_df

A data frame containing individual data.

n_trials

The total number of trials in the data frame.

n_replicates

The total number of replicates in each trial.

max_variance

The maximum allowed variance value.

variance_set

A vector of variance values.

Value

A list calculated for the individual data frame. Contains two values:

  1. n_crossings: The number of crossover events in the data.

  2. base_score: The un-normalized profile repeatability score for the data.

Details

This function calculates a score for an individual data frame based on various factors, including the number of crossovers, maximum variance, and a set of variances.

The score is computed as follows:

  • It factors in the number of crossovers using a scaling factor.

  • It considers the maximum variance value in the variance set.

  • It adds a component based on the average of variance values.

  • It includes a scaled component of the number of crossovers.

See also

calculate_crossovers for information on crossovers calculation.

Examples

arr <- data.frame(
  individual=c("a", "a"),
  time=c(5, 15),
  col_a=c(1, 2),
  col_b=c(2, 3)
)
variance_set <- c(0.5, 0.5)
max_variance <- 0.5
score_list <- score_individual_df(
  individual_df=arr,
  n_trials=2,
  n_replicates=2,
  max_variance=max_variance,
  variance_set=variance_set
)
print(score_list)
#> $n_crossings
#> [1] 0
#> 
#> $base_score
#> [1] 1.001
#>