Inference for the Middle True Class Fraction

Duc-Khanh To

2026-11-05

Simulated data

mu_true <- c(0, 2.5, 3.69)
sigma_true <- c(1, 1.1, 1.2)
n1 <- 30
n2 <- 50
n3 <- 30
X1 <- rnorm(n1, mu_true[1], sigma_true[1])
X2 <- rnorm(n2, mu_true[2], sigma_true[2])
X3 <- rnorm(n3, mu_true[3], sigma_true[3])
out_tcf2 <- tcf2(x = X1, y = X2, z = X3, tcf10 = 0.8, tcf30 = 0.8, 
                 tcf20 = 0.5, plot = TRUE)

out_tcf2
#> 
#> CALL: tcf2.default(x = X1, y = X2, z = X3, tcf10 = 0.8, tcf30 = 0.8, 
#>     tcf20 = 0.5, plot = TRUE)
#>  
#> TCF1:
#> [1] 0.8
#> TCF3:
#> [1] 0.8
#> Thresholds estimate:
#> [1] 0.9402617 3.1406283
#> TCF2 estimate:
#> [1] 0.62
#> 
#> 95% Confidence interval:
#> [1] 0.3106687 0.8720559
#> 
#>  p-value: 0.4571848
data_test <- data.frame(biom = c(X1, X2, X3), 
                        diag = rep(c("1", "2", "3"), c(n1, n2, n3)))
out_tcf2_2 <- tcf2(formula = biom ~ diag, data = data_test, tcf10 = 0.8, 
                   tcf30 = 0.8, tcf20 = 0.5, plot = TRUE)

out_tcf2_2
#> 
#> CALL: tcf2.formula(formula = biom ~ diag, data = data_test, tcf10 = 0.8, 
#>     tcf30 = 0.8, tcf20 = 0.5, plot = TRUE)
#>  
#> TCF1:
#> [1] 0.8
#> TCF3:
#> [1] 0.8
#> Thresholds estimate:
#> [1] 0.9402617 3.1406283
#> TCF2 estimate:
#> [1] 0.62
#> 
#> 95% Confidence interval:
#> [1] 0.3106687 0.8720559
#> 
#>  p-value: 0.4571848
summary(out_tcf2_2)
#> $estimate
#> [1] 0.62
#> 
#> $conf.int
#> [1] 0.3106687 0.8720559
#> 
#> $p.value
#> [1] 0.4571848
#> 
#> $n
#> n1 n2 n3 
#> 30 50 30 
#> 
#> attr(,"class")
#> [1] "summary.tcf2"

mirror server hosted at Truenetwork, Russian Federation.