BIiwls: Iterative Weighted Least Squares (IWLS) method for binomial...

Description Usage Arguments Details Value Author(s) References Examples

Description

BIiwls performs estimation of the coefficients of binomial logistic regressions by iterative wieghted least squares method.

Usage

1
BIiwls(y,X,m,maxiter)

Arguments

y

response dependent variable which follows a binomial distribution.

X

model matrix.

m

number of trials in each binomial observation.

maxiter

maximum number of iterations in the method.

Details

The iterative weighted least squares (IWLS) is a general algorithm to find the maximum likelihood estimations (mle) and standard deviations in generalized linear models. There are several ways to derive it, but the one that has been developed in this function is via the Newton-Raphson method. It consists of making a Taylor expansion in the score function, the first derivate of the log-likelihood, around the mle. This especific IWLS, BIiwls, has been developed to find out the mle and the standard errors in logistic regression by the introduction of a dependent variable, a matrix model of the regression covariates and the number of trials of the binomial dependent variable.

Value

beta

maximum likelihood estimations of the logistic regression coefficients.

vcov

variance-covariance matrix of the estimated regression coefficients.

iter

number of iterations of the algorithm.

Author(s)

J. Najera-Zuloaga

D.-J. Lee

I. Arostegui

References

Pawitan Y. (2001): In All Likelihood: Statistical Modelling and Inference Using Likelihood, Oxford University Press

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# We create a variable and a matrix model that consists of
# two covariates.
k=1000                    
m=10 
maxiter=100

y <- rbinom(k,m,0.87) 
x1 <- rnorm(k,1,50)
x2 <- rnorm(k,30,9) 
X <- cbind(1,x1,x2)

BIiwls(y,X,m,maxiter)

Example output

$beta
            [,1]
    1.8677426835
x1 -0.0009534933
x2  0.0018703887

$vcov
                            x1            x2
    1.049778e-02 -3.987353e-06 -3.180111e-04
x1 -3.987353e-06  3.667554e-07  8.597701e-08
x2 -3.180111e-04  8.597701e-08  1.054047e-05

$iter
[1] 4

$conv
[1] "yes"

HRQoL documentation built on May 2, 2019, 5:42 a.m.

Related to BIiwls in HRQoL...