Learn R Programming

misaem (version 1.0.1)

log_reg: log_reg

Description

Calculate the likelihood or log-likelihood for one observation of logistic regression model .

Usage

log_reg(y, x, beta, iflog = TRUE)

Arguments

y

Response value (0 or 1).

x

Covariate vector of dimension \(p \times 1\).

beta

Estimated parameter of logistic regression model.

iflog

If TRUE, log_reg calculate the log-likelihood; else likelihood.

Value

Likelihood or log-likelihood.

Examples

Run this code
# NOT RUN {
res = log_reg(1,c(1,2,3),c(1,-1,1))
# }

Run the code above in your browser using DataLab