Learn R Programming

MVB (version 1.1)

unifit: univariate model fitting

Description

fit univariate log-linear model using Newton-Raphson algorithm.

Usage

unifit(formula, data = list(), family = c("gaussian", "binomial"), output = 0)

Arguments

formula
a symbolic description of the model to be fit.
data
an optional data frame containing the variables in the model. By default the variables are taken from the environment from which unifit is called.
family
a GLM family, currently support gaussian and binomial.
output
with values 0 or 1, indicating whether the fitting process is muted or not.

Value

An object of class mvbfit, for which some methods are available.

Details

The unifit utilize the class structure of the underlying C++ code and fitted the model with Newton-Raphson algorithm.

See Also

unilps, mvbfit

Examples

Run this code
n <- 100
p <- 4
x <- matrix(rnorm(n * p, 0, 4), n, p)
eta <- x 
pr <- exp(eta) / (1+ exp(eta))
res <- rbinom(n, 1, pr)
fit <- unifit(res ~ x - 1, family = 'binomial')

Run the code above in your browser using DataLab