Learn R Programming

bayess (version 1.6)

loglinll: Log of the likelihood of the log-linear model

Description

This function provides a direct computation of the logarithm of the likelihood of a standard log-linear model, as defined in Chapter 4.

Usage

loglinll(beta, y, X)

Value

returns the logarithmic value of the logit likelihood for the data y, covariate matrix X and parameter vector beta

Arguments

beta

coefficient of the logit model

y

vector of binary response variables

X

covariate matrix

Examples

Run this code
X=matrix(rnorm(20*3),ncol=3)
beta=c(3,-2,1)
y=rpois(20,exp(X%*%beta))
loglinll(beta, y, X)

Run the code above in your browser using DataLab