tests/testthat/test-tobit.R

# REQUIRE TEST Monte Carlo test tobit ---------------------------------------------

test_that('REQUIRE TEST tobit Monte Carlo', {
    z <- ztobit$new()
    test.tobit <- z$mcunit(minx = 0, plot = FALSE)
    expect_true(test.tobit)
})

# REQUIRE TEST update tobit formula --------------------------------------------
test_that('REQUIRE TEST update tobit formula', {
    data(tobin)
    z5<-ztobit$new()
    z5$zelig(durable ~ age + quant, data = tobin)

    z5.1_coefs <- coef(z5)

    controls <- ~ quant
    z5$zelig(formula = update(controls, durable ~ age + .), data = tobin)

    expect_equal(z5.1_coefs, coef(z5))
})

Try the Zelig package in your browser

Any scripts or data that you put into this service are public.

Zelig documentation built on Jan. 8, 2021, 2:26 a.m.