This function provides values for a profile likelihood and a normalized profile likelihood for a parameter of interest in a generalized linear model.
profilelike.glm(formula, data, profile.theta, family = stats::gaussian,
offset.glm = NULL, lo.theta = NULL, hi.theta = NULL, length = 300,
round = 2, subset = NULL, weights = NULL, offset = NULL, ...)
numerical grid values for a parameter of interest in a specified range (between lower and upper bounds).
numerical values for a profile likelihood corresponding to theta in a specified range (between lower and upper bounds).
numerical values for a normalized profile likelihood ranging from 0 to 1.
see corresponding documentation in glm
.
a data frame. See corresponding documentation in glm
.
a parameter of interest, theta; must be a numeric variable.
see corresponding documentation in glm
.
same usage as offset in glm
. See corresponding documentation for offset in glm
.
lower bound for a parameter of interest to obtain values for a profile likelihood.
upper bound for a parameter of interest to obtain values for a profile likelihood.
length of numerical grid values for a parameter of interest to obtain values for a profile likelihood.
the number of decimal places for round
function to automatically define lower and upper bounds of numerical grid for a parameter of interest. If an automatically defined parameter range is not appropriate, increase the number or specify lo.theta and hi.theta.
should not be provided.
should not be provided.
should not be provided. Instead use offset.glm.
further arguments passed to or from other methods.
Leena Choi <naturechoi@gmail.com>
Arguments weights, subset, and offset in the glm
function are not comparable.
Missing values should be removed.
This function provides values for a profile likelihood and a normalized profile likelihood for a parameter of interest in a generalized linear model. Users must define a parameter of interest in a generalized linear model. This function can be used for generalized linear models comparable with the glm
function. However, arguments weights, subset, and offset should not be provided. An argument offset in glm
function can be provided using offset.glm. A normalized profile likelihood is obtained by a profile likelihood being divided by the maximum value of the profile likelihood so that a normalized profile likelihood ranges from 0 to 1.
profilelike.plot
, profilelike.summary
, profilelike.lm
, profilelike.polr
, profilelike.gls
, profilelike.lme
, glm
data(dataglm)
xx <- profilelike.glm(y ~ x1 + x2, data=dataglm, profile.theta="group",
family=binomial(link="logit"), length=500, round=2)
profilelike.plot(theta=xx$theta, profile.lik.norm=xx$profile.lik.norm, round=2)
Run the code above in your browser using DataLab