View source: R/fit.cosinor.mixed.R
fit.cosinor.mixed | R Documentation |
Given an outcome, predictor variable, fit the cosinor mixed model with optional covariate effects
fit.cosinor.mixed(
y,
x = NULL,
random,
interaction = NULL,
data,
na.action = na.omit
)
y |
a vector specifying the outcome variable /phenotype variable |
x |
a vector specifying the predictor variables |
random |
a vector specifying the random effects as specified in lmer formula. e.g. "1|participant_id". |
interaction |
a vector specifying the variables for interactions |
data |
a dataframe with the x,y, covariates, random variables |
na.action |
how to deal with missing data, default is na.action = na.omit |
library(lme4)
data("db.model")
## examine the effects of gender on MESOR, acrophase, amplitude on hrv
f<-fit.cosinor.mixed(y="hrv", x="gender", random="1|participant_id", data=db.model)
summary(f)
## examine the interaction effects of gender and baseline bmi categories on MESOR, acrophase, amplitude on hrv
f2<-fit.cosinor.mixed(y="hrv",interaction=c("gender","bmi_baseline_cat"),random="1|participant_id", data=db.model)
summary(f2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.