powered by
Computes the value of g such that width of the \(1-\alpha\) confidence interval at sample size n is minimized
optimal_g(n, number_of_coefficients, alpha)
A positive numeric scalar representing the optimal \(g\) that minimizes the CI width.
A positive sample size integer.
A positive integer of coefficients in the full model
A positive numeric scalar in (0,1) for nominal Type I error.
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