extended.glm: A custom wrapper for base function...

View source: R/regression.R

extended.glmR Documentation

A custom wrapper for base function glm(family=binomial("logit))

Description

This function takes a matrix of candidate predictors X and a vector of binary response variables Y. .

Usage

extended.glm(X, Y)

Arguments

X

an n by p matrix of candidate predictors.

Y

an n by 1 vector of binary responses

Examples

n <- 1000
B0 <- 3
B1 <- 5
X1 <- rnorm(n)
B2 <- -2
X2 <- rnorm(n)
X <- as.matrix(cbind(X1=X1,X2=X2))
Z <- B0 + B1*X1 + B2*X2
pr=exp(Z)/(1+exp(Z))
Y <- rbinom(n,1,pr)
fit <- extended.glm(X,Y2)
coef(fit)

snelson89/extendedglmnetGroup7 documentation built on May 12, 2022, 7:38 p.m.