calculate_lmer_estimates_covariate
calculate_lmer_estimates.Rd
This function performs a (generalized) linear mixed model analysis using (g)lmer.
Note: The current version does not accept categorical response variables, sample size parameters smaller than the observed samples size
Usage
calculate_lmer_estimates(
data,
condition_column,
experimental_columns,
response_column,
total_column,
condition_is_categorical,
covariate = NULL,
crossed_columns = NULL,
error_is_non_normal = FALSE,
family_p = NULL,
na.action = "complete",
include_interaction = FALSE,
random_slope_variable = NULL,
covariate_is_categorical = TRUE
)
Arguments
- data
Input data
- condition_column
Name of the condition variable (ex variable with values such as control/case). The input file has to have a corresponding column name
- experimental_columns
Name of variables related to experimental design such as "experiment", "plate", and "cell_line". They should be in order, for example, "experiment" should always come first .
- response_column
Name of the variable observed by performing the experiment. ex) intensity.
- total_column
Set this column only when family_p="binomial" and it is equal to the total number of observations (number of cases plus number of controls) for a given number of cases, when family_p="poisson" or "negative_binomial" and it is represents the total number of observations to be used as offset in the model
- condition_is_categorical
Specify whether the condition variable is categorical. TRUE: Categorical, FALSE: Continuous.
- covariate
The name of the covariate to control in the regression model
- crossed_columns
Name of experimental variables that may appear repeatedly with the same ID. For example, cell_line C1 may appear in multiple experiments, but plate P1 cannot appear in more than one experiment
- error_is_non_normal
Default: the observed variable is continuous Categorical response variable will be implemented in the future. TRUE: Categorical , FALSE: Continuous (default).
- family_p
The type of distribution family to specify when the response is categorical. If family is "binary" then binary(link="log") is used, if family is "poisson" then poisson(link="logit") is used, if family is "poisson_log" then poisson(link=") log") is used.
- na.action
"complete": missing data is not allowed in all columns (default), "unique": missing data is not allowed only in condition, experimental, and response columns. Selecting "complete" removes an entire row when there is one or more missing values, which may affect the distribution of other features.
- include_interaction
Whether to include condition * covariate interaction
- random_slope_variable
Variable for random slopes (typically "condition_column")
- covariate_is_categorical
Specify whether the covariate variable is categorical. TRUE: Categorical, FALSE: Continuous.
Examples
result=calculate_lmer_estimates(data=RMeDPower_data1,
condition_column="classification",
experimental_columns=c("experiment", "line"),
response_column="cell_size1",
condition_is_categorical=TRUE,
covariate="covariate",
crossed_columns = "line",
family_p=NULL,
error_is_non_normal=FALSE)
#> [1] "covariate should be null or one of the column names"