Sync portfolio laboratory source
This commit is contained in:
commit
c0f6d301e8
5 changed files with 86 additions and 0 deletions
15
analysis.R
Normal file
15
analysis.R
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# Синтетические данные и расчёт метрик для обоих дашбордов.
|
||||
set.seed(2026)
|
||||
control <- rnorm(35, 50, 7)
|
||||
treated <- rnorm(45, 55, 10)
|
||||
test <- t.test(treated, control, var.equal = FALSE, conf.level = 0.95)
|
||||
result <- data.frame(statistic = c("lower", "estimate", "upper"),
|
||||
difference = c(test$conf.int[1], mean(treated) - mean(control), test$conf.int[2]))
|
||||
|
||||
# Проверяет конечность основной метрики перед экспортом.
|
||||
stopifnot(nrow(result) > 1, all(is.finite(result$difference)))
|
||||
if (sys.nframe() == 0L) {
|
||||
arguments <- commandArgs(trailingOnly = TRUE)
|
||||
stopifnot(length(arguments) == 1L)
|
||||
write.csv(result, arguments[1], row.names = FALSE)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue