knitr::opts_chunk$set( error = TRUE, collapse = TRUE, comment = "#>", out.width = "100%" )
library(testthat) library(jeksterslabRboot) context("Test wald.")
thetahat <- 0.860 sehat <- 0.409 sqrt_wald <- 2.10 p <- 0.036
result_01 <- sqrt_wald_test( thetahat = thetahat, sehat = sehat, null = 0, dist = "z" ) result_01 result_02 <- sqrt_wald_test( thetahat = thetahat, sehat = sehat, null = 0, dist = "t", df = 1000 ) result_02 result_03 <- wald_test( thetahat = thetahat, varhat = sehat^2 ) result_03
test_that("statistic", { expect_equivalent( result_01[1], result_02[1], sqrt(result_03[1]), sqrt_wald ) })
test_that("p", { expect_equivalent( round( result_01[2], digits = 3 ), round( result_02[2], digits = 3 ), p ) })
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.