get_vars {profrep} | R Documentation |
Calculate Group Variance
Description
Calculate Group Variance
Usage
get_vars(individual_array, n_replicates)
Arguments
individual_array |
The array of data for an individual |
n_replicates |
The number of replicate groups |
Details
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.
Value
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
Examples
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)
[Package profrep version 1.0.0 Index]