Learn R Programming

supportInt (version 1.1)

supportInt-package: \Sexpr[results=rd,stage=build]{tools:::Rd_package_title("#1")}supportIntCalculates Likelihood Support Intervals for Common Data Types

Description

\Sexpr[results=rd,stage=build]{tools:::Rd_package_description("#1")}supportIntCalculates likelihood based support intervals for several common data types including binomial, Poisson, normal, lm(), and glm(). For the binomial, Poisson, and normal data likelihood intervals are calculated via root finding algorithm. Additional parameters allow the user to specify whether they would like to receive a parametric bootstrap estimate of the confidence level of said support interval. For lm() and glm(), the function returns profile likelihoods for each coefficient in the model.

Arguments

Examples

Run this code
#Binomial data 
binLikSI(4, 10, 8)

#Poisson data returning the estimated confidence level
poisLikSI(4, 8, conf=TRUE)

#GLM coefficients
set.seed(10)
x <- rnorm(50, 0 , 5)
expit <- function(z) exp(z)/(1+exp(z))
p <- expit(.1+ .4*x)
y <- sapply(1:length(p), function(z) rbinom(1,1, p[z]))
glm.obj <- glm(y~x, family="binomial")
glmLikSI(glm.obj, 8)

Run the code above in your browser using DataLab