plot
method for class "chandwich". Only applicable to an object
x
for which attr(x, "p_current") = 1
, i.e. a model with
one free parameter.
# S3 method for chandwich plot(x, y, type = 1, legend = length(type) > 1, legend_pos = "topleft", ...)
x | an object of class "chandwich", a result of a call to
|
---|---|
y | Not used. |
type | An integer vector, a subset of the numbers |
legend | A logical scalar or a character vector. If this is
supplied then a legend is added to the plot. If |
legend_pos | The position of the legend (if required) specified using
the argument |
... | Additional arguments passed to If the argument |
Nothing is returned.
adjust_loglik
to adjust a user-supplied
loglikelihood function.
summary.chandwich
for maximum likelihood estimates
and unadjusted and adjusted standard errors.
conf_intervals
and plot.confint
to
plot confidence intervals for individual parameters.
conf_region
and plot.confreg
to
plot a confidence region for a pair of parameters.
# ------------------------- Binomial model, rats data ---------------------- # Contributions to the independence loglikelihood binom_loglik <- function(prob, data) { if (prob < 0 || prob > 1) { return(-Inf) } return(dbinom(data[, "y"], data[, "n"], prob, log = TRUE)) } rat_res <- adjust_loglik(loglik = binom_loglik, data = rats, par_names = "p") # Vertically adjusted loglikelihood only plot(rat_res)# Plot over (0,1) and reposition the legend plot(rat_res, type = 1:4, xlim = c(0, 1), legend_pos = "bottom")