Hi. I hope to get some help with this package (cosinoRmixedeffects) I'm trying to use with my data. Below shows the steps and the first few data entries, and the error I get at the end. Please let me know if you need more info to help advise. Thanks very much.
library(dplyr)
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
library(emmeans)
library(ggplot2)
library(limma)
library(lme4)
Loading required package: Matrix
library(MatrixModels)
Attaching package: ‘MatrixModels’
The following object is masked from ‘package:lme4’:
mkRespMod
library(reshape2)
library(cosinoRmixedeffects)
library(readxl)
ditcr <- read_excel("DIT CR_R Testrun.xlsx",
-
range = "A1:D151")
head(ditcr)
A tibble: 6 × 4
protocol subject phase dit
1 1 N01 122. 161.
2 1 N01 214. 107.
3 1 N01 306. 10.7
4 1 N01 38.5 156.
5 1 N01 131. 65.4
6 1 N02 121. 168.
create cosinor paramenters needed for cosinor model
ditcrmodel<-create.cosinor.param(time="phase", period=360, data=ditcr)
head(ditcrmodel)
A tibble: 6 × 7
protocol subject phase dit t$phase rrr$phase sss$phase
1 1 N01 122. 161. 122. -0.523 0.852
2 1 N01 214. 107. 214. -0.830 -0.557
3 1 N01 306. 10.7 306. 0.590 -0.807
4 1 N01 38.5 156. 38.5 0.783 0.622
5 1 N01 131. 65.4 131. -0.653 0.757
6 1 N02 121. 168. 121. -0.516 0.857
Fit Model
f1<-fit.cosinor.mixed(y="dit",x="protocol",random="1|subject", data=ditcrmodel)
Error in model.frame.default(data = data, na.action = na.action, drop.unused.levels = TRUE, :
invalid type (list) for variable 'rrr'