ml.rgr: Logistic Regression with Maximum Likelihood Estimation

Description Usage Arguments Details Value Examples

Description

Fit a logistic regression model using maximum likelihood estimation

Usage

1
ml.rgr(dataset)

Arguments

dataset

a p x m data matrix, where the final column is a binary outcome variable. datashape may be applied to data so that the dataset is in the correct format for this function (see manual)

Details

This function is a wrapper for glm.fit, for convenient application within several functions in the apricomp package. This function may be called directly. For regression with an intercept included, the first column in the dataset must be a column of 1s.

Value

The function returns a column-vector containing the logistic regression coefficients and intercept (if specified).

Examples

1
2
3
4
5
6
## Logistic regression using a subset of the mtcars data (outcome is "vs")
data(mtcars)
mtc.df <- mtcars[, c(8, 1, 9)]
mtc.shaped <- datashape(dataset = mtc.df, y = 1)
ml.rgr(mtc.shaped)
ml.rgr(cbind(1,mtc.shaped))

apricom documentation built on May 2, 2019, 6:21 a.m.

Related to ml.rgr in apricom...