This is an internal function that provides the range where the profileLikelihood function would search for MLE.
getGridBound(formula,data,bse,k,m,family,robust)
a formula specifying the response and possible covariates to keep in the output dataframe. This is directly obtained from evian
function.
a data frame inputted from the output of subsetData
.
numeric. The number of beta standard errors to utilize in constraining the beta grid limits. Passed down from argument bse
in the main evian
function.
numeric vector. The strength of evidence criterion k. Passed down from argument kcutoff
in the main evian
function.
numeric. The density of the grid at which to compute the standardized likelihood function. Passed down from argument m
in the main evian
function.
a string representing the link function for ProfileLikelihood::ProfileLikelihood.glm
.
A numeric value, robust correction factor.
This function returns a numeric vector of length 2 that represents the lower and upper bounds of the grid for the MLE search.
getGridBound
is an interior function that searches for the proper grid range that would be used to search for MLE. This is done through two steps: First, it finds a starting grid range by fitting a (generalized) linear model to obtain the estimate and s.e. of the beta. Then the starting grid range can be defined as mean +- bse*s.e. . In the case where robust correction is needed, the grid will be defined as mean +- bse*s.e./correction factor. Then the function determines an optimal grid range by using expandBound
function.