context("Contrasts")
test_that("contrasts",
{
data(phone, package = "flipExampleData")
phone$q4 <- ordered(phone$q4)
z <- Regression(q25 ~ q4, data = phone, contrasts = c("contr.treatment", "contr.poly"))
options("contrasts" = c("contr.treatment", "contr.poly"))
z1 <- lm(q25 ~ q4, data = phone)
expect_equal(names(z$coef), names(z1$coef))
z <- Regression(q25 ~ q4, data = phone)
z1 <- lm(q25 ~ q4, data = phone)
expect_false(all(names(z$coef) == names(z1$coef)))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.