Learn R Programming

avlm (version 0.1.0)

optimal_g: Computes the value of g such that width of the \(1-\alpha\) confidence interval at sample size n is minimized

Description

Computes the value of g such that width of the \(1-\alpha\) confidence interval at sample size n is minimized

Usage

optimal_g(n, number_of_coefficients, alpha)

Value

A positive numeric scalar representing the optimal \(g\) that minimizes the CI width.

Arguments

n

A positive sample size integer.

number_of_coefficients

A positive integer of coefficients in the full model

alpha

A positive numeric scalar in (0,1) for nominal Type I error.

Examples

Run this code
n <- 10000
alpha <- 0.05
g_star <- optimal_g(n, 5, alpha)
cat("The optimal g is:", g_star, "\n")

Run the code above in your browser using DataLab