Skip to content

Commit a2d4581

Browse files
committed
unit tests, comparison with polle and ate function
1 parent e3e23bf commit a2d4581

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

inst/tinytest/test_cate.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
library("tinytest")
22

3+
n <- 1000
4+
x <- rnorm(n)
5+
a <- rbinom(n, 1, lava::expit(1 + x))
6+
y <- 1 + a + x - a * x + rnorm(n)
7+
d <- data.frame(y = y, a = a, x = x)
8+
39
true_estimate1 <- function(q1) {
410
g <- glm(a ~ x, data = d, family = binomial)
511
pi <- predict(g, type = "response")

0 commit comments

Comments
 (0)