fit.cosinor.mixed: Fit a cosinor mixed model

View source: R/fit.cosinor.mixed.R

fit.cosinor.mixedR Documentation

Fit a cosinor mixed model

Description

Given an outcome, predictor variable, fit the cosinor mixed model with optional covariate effects

Usage

fit.cosinor.mixed(
  y,
  x = NULL,
  random,
  interaction = NULL,
  data,
  na.action = na.omit
)

Arguments

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

Examples


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)


maytesuarezfarinas/cosinoRmixedeffects documentation built on Oct. 30, 2024, 9:31 p.m.