diff --git a/DESCRIPTION b/DESCRIPTION index 98a47a11..9b79541b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -27,6 +27,7 @@ Imports: scales, stats Suggests: + cosinor, covr, dplyr, DT, diff --git a/R/srr-stats-standards.R b/R/srr-stats-standards.R index 6ff237d0..d696eabc 100644 --- a/R/srr-stats-standards.R +++ b/R/srr-stats-standards.R @@ -149,7 +149,7 @@ NULL #' @srrstatsNA {RE4.15} #' @srrstatsNA {RE4.16} #' @srrstatsNA {RE5.0} -# @srrstatsNA {RE7.0} +#' @srrstatsNA {RE7.0} #' @srrstatsNA {RE7.0a} #' @srrstatsNA {RE7.1} #' @srrstatsNA {RE7.1a} diff --git a/tests/testthat/test-cosinor.R b/tests/testthat/test-cosinor.R index c5754032..fd0e17fe 100644 --- a/tests/testthat/test-cosinor.R +++ b/tests/testthat/test-cosinor.R @@ -6,6 +6,7 @@ #' @srrstats {G5.5} #' @srrstats {G5.4} #' @srrstats {G5.4a} +#' @srrstats {G5.4b} #' @srrstats {G5.6} #' @srrstats {G5.6a} #' @srrstats {G5.6b} @@ -50,6 +51,7 @@ test_that("model returns accurate parameters", { ), data = comod ) + cosinor_lm_mod <- cosinor::cosinor.lm(Y ~ time(times) + group + amp.acro(group), data = comod) } ) testthat::expect_true(all.equal( @@ -57,6 +59,17 @@ test_that("model returns accurate parameters", { c(1.0030, -0.4966, 2.0122, 0.9948, 3.0115, 0.3175) )) + # test similarity to cosinor::cosinor.lm() + comparison_df <- cbind( + cosinor_lm_mod$coefficients, + object$coefficients + ) + + comparison_df <- as.data.frame(comparison_df[rownames(comparison_df) != "acr", ]) + expect_equal(comparison_df$V1, comparison_df$V2, tolerance = 0.1) + + + # test another parameter estimation of Gaussian simulated data withr::with_seed( 100,