get_vars | R Documentation |
Calculate Group Variance
get_vars(individual_array, n_replicates)
individual_array |
The array of data for an individual |
n_replicates |
The number of replicate groups |
For the given individual array, for all rows of times, computes the variance in values over replicates.
Returns these variances, sum of all values (for all times and replicates), sum of all these values squared, and the number of values.
A list, where the elements are:
1. variances: A vector of the variances of the sample 2. total_sum: The sum of all the measurements in the sample 3. ssq: The sum of all the squares of the measurements in the sample 4. num_measurements: The total number of measurements in the sample that are not null
arr <- data.frame(
individual=c("a", "a"),
time=c(5, 15),
col_a=c(1, 2),
col_b=c(2, 3)
)
variance_return <- get_vars(individual_array=arr, n_replicates=2)
print(variance_return)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.