Nothing
test_that("fit print identifies fixed asymptotes and censored Beta limits", {
raw <- simulate_tls(family = "beta", times = c(1, 2, 4, 8), reps = 4,
CTmax = 36, z = 4, phi = 40, seed = 214)
raw$left <- FALSE
raw$limit <- 0.05
raw$prop <- pmax(raw$prop, 0.08)
raw$left[c(1, 5)] <- TRUE
raw$prop[c(1, 5)] <- 0.02
d <- standardize_data(raw, temp = "temp", duration = "duration",
proportion = "prop", left_censored = "left",
censor_limit = "limit", duration_unit = "hours")
fit <- fit_4pl(d, family = "beta", t_ref = 60, fixed_low = 0.01,
fixed_up = 0.99, quiet = TRUE)
printed <- paste(capture.output(print(fit)), collapse = "\n")
expect_match(printed, "Fixed asymptotes: low = 0.01; up = 0.99")
expect_match(printed,
"Left-censored Beta rows: 2; detection limits: 0.05 to 0.05")
summarized <- summary(fit)
expect_s3_class(summarized, "summary.profile_tls")
expect_identical(summarized$print_details,
tls_fit_print_details(fit$fit))
fixed_rows <- summarized$coefficients$parameter %in% c("low", "up")
expect_true(all(summarized$coefficients$scale[fixed_rows] ==
"fixed (natural)"))
expect_true(all(is.na(summarized$coefficients$std.error[fixed_rows])))
expect_true(all(is.na(summarized$coefficients$statistic[fixed_rows])))
expect_true(all(is.na(summarized$coefficients$p.value[fixed_rows])))
summary_text <- character()
invisible(capture.output(withCallingHandlers(
print(summarized),
message = function(m) {
summary_text <<- c(summary_text, conditionMessage(m))
invokeRestart("muffleMessage")
}
)))
expect_match(paste(summary_text, collapse = "\n"),
"Fixed asymptotes: low = 0.01; up = 0.99")
expect_match(paste(summary_text, collapse = "\n"),
"Left-censored Beta rows: 2; detection limits: 0.05 to 0.05")
legacy <- fit
legacy$fit$data_summary$n_left_censored <- NULL
expect_no_error(invisible(capture.output(print(legacy))))
expect_no_error(suppressMessages(
invisible(capture.output(print(summary(legacy))))
))
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.