comparison_test_single: Performs a single between- or within-individual experiments...

View source: R/experiments.R

comparison_test_singleR Documentation

Performs a single between- or within-individual experiments comparing melatonin suppression at two lux levels using t tests

Description

For a between-individual experiment, a t-test is used to compare the melatonin suppression level at two lux values for two different samples of individuals. This function requires based an (ideally large) simulated population of individual dose-response data.

Usage

comparison_test_single(is_between, lux_1, lux_2, n, population_df)

Arguments

is_between

a Boolean indicating whether experiment is within or between type

lux_1

first measured lux value

lux_2

second measured lux value

n

number of individuals in sample

population_df

a tibble representing a virtual experiment

Details

For a within-individual, a paired t-test is used to compare the melatonin suppression level at two lux values for a sample of individuals measured at each of those values. This function requires based an (ideally large) simulated population of individual dose-response data.

Value

a named list comprising 'result': a binary value indicating test success (if=1) or failure (if=0) to detect difference of correct sign; and 'p_value': the p-value from the t test


mellux-project/melluxdrc documentation built on March 25, 2022, 8:09 p.m.