lbm {lbm} | R Documentation |
Log binomial regression model in Exact method
Description
If the maximum likelihood (ML) solution lies on the boundary of the
parameter space in log binomial model, a special method is needed
since the standard fitting algorithm may meet numerical difficulties.
Exact method can overcome the difficulties and address the ML solution
when it lies on the boundary of the parameter space.lbm
implemented the exact method to address the ML solution in the log binomial model.
Usage
lbm(formula, data,contrasts = NULL,subset,na.action,lfv=0.95,
vce = "oim",rescode=NULL,control=lbm.control(),...)
Arguments
formula |
an object of class " |
data |
an optional data frame, list or environment (or object
coercible by |
contrasts |
an optional list. See the |
subset |
a specification of the rows to be used: defaults to all rows.
This can be any valid indexing vector (see [ |
na.action |
a function which indicates what should happen when the data
contain |
lfv |
a testing range option which decides the range of boundary vector candidates included for testing. The default value is 0.95, which means the covariate vectors with probability greater than 0.95 will be included into boundary pairing system as boundary vector candidates. |
vce |
the type of the information matrix used to attain the variance-covariance matrix.
Two options could be selected, observed information matrix (OIM) and expected information
matrix (EIM). The default |
rescode |
is an option to code the response variable if it is a factor. |
control |
The |
... |
For |
Details
A typical predictor has the form response ~ terms
where
response is the (numeric) response vector and terms is a series of
terms which specifies a linear predictor for response. A terms
specification of the form first + second
indicates all the
terms in first together with all the terms in second with any
duplicates removed.
A specification of the form first:second
indicates the set of
terms obtained by taking the interactions of all terms in first with
all terms in second. The specification first*second
indicates
the cross of first and second. This is the same as
first + second + first:second
.
The terms in the formula will be re-ordered so that main effects come
first, followed by the interactions, all second-order, all third-order
and so on: to avoid this pass a terms object as the formula.
Value
lbm
returns an object of class inheriting from "lbm"
which
inherits from the class "lbm"
. The function summary
(i.e.,
summary.lbm
) can be used to obtain or print a summary of the estimates
and the relevant confidence interval. The argument CF.lvl
in
summary
represents the level of confidence interval claimed in the
model. The default value is CF.lvl=0.95
. Optionally, Risk ratio estimates
and their related confidence interval are offered as an argument RR
in
the summary
. The default RR=FALSE
is not to display them.
An object of class "lbm"
is a list containing at least the following
components:
coefficients |
a named vector of coefficients |
residuals |
the working residuals, that is the residuals in the final iteration of the IWLS fit. |
fitted.values |
the fitted mean values, obtained by transforming the linear predictors by the inverse of the log link function. |
linear.predictors |
the linear fit on log scale. |
deviance |
twice the absolute value of maximized log-likelihood. |
aic |
A version of Akaike's An Information Criterion, minus twice the
maximized log-likelihood plus twice the number of parameters, computed by
the |
null.deviance |
The deviance for the null model, comparable with
|
df.residual |
the residual degrees of freedom. |
df.null |
the residual degrees of freedom for the null model. |
response |
the response vector used in the mode.l |
vcov |
the unscaled ( |
vce |
the type of information matrix applied. |
call |
the matched call. |
na.action |
(where relevant) information returned by |
contrasts |
(where relevant) the contrasts used. |
formula |
the formula supplied. |
factor |
the order of factors used in the response variable. |
bvector |
the matrix of boundary vectors. |
bv |
logical. Determines whether the model has boundary vectors. |
References
Petersen, M. R. & Deddens, J. A. (2010). Maximum likelihood estimation of the log-binomial model. Communications in Statistics - Theory and Methods, 39: 5, 874 - 883.
See Also
glm
, lm
.
Examples
## Two examples are from Petersen, M. R. & Deddens, J. A. (2010).
## Example 1.
x<-c(1:10)
y<-c(0,0,0,0,1,0,1,1,1,1)
data<-data.frame(x,y)
a<-lbm(formula=y~x,data=data,vce="eim")
## Example 2.
x1<-c(1:11)
x2<-x1^2
y<-c(10,6,4,3,3,2,3,3,4,6,10)
dat<-cbind(x1,x2,y)
dat1<-apply(dat, 1, function(t) {
temp<-data.frame(x1=rep(t[1],10),x2=rep(t[2],10),y=0)
temp$y[1:t[3]]<-1
return(temp)
})
data<-do.call(rbind, dat1)
a<-lbm(formula=y~x1+x2,data=data)
summary(a)