GLM_Model: Generalized Linear Model

View source: R/GLM_Model.R

GLM_ModelR Documentation

Generalized Linear Model

Description

Generalized Linear Model

Usage

GLM_Model(Data, xvar, yvar)

Arguments

Data

The name of the Dataset.

xvar

X variables.

yvar

Y variable.

Details

Let y be a vector of response variable of accessing credit for each applicant n, such that y_{i} = 1 if the applicant-i has access to credit, and zero otherwise. Furthermore, let let \bold{x} = x_{ij}, where i=1,...,n and j=1,...,p characteristics of the applicants. The log-odds can be define as:

log(\frac{π_{i}}{1-π_{i}}) = β_{0}+\bold{x}_{\bold{i}}β = β_{0}+∑_{i=1}^{p}β_{i}\bold{x}_{i}

β_{0} is the intercept, β = (β_{1},…, β_{p}) is a p x 1 vector of coefficients and x_{i} is the i_{th} row of x.

Value

The output from GLM_Model.

Examples

yvar <- c("multi.level")
sample_data <- sample_data[c(1:750),]
xvar <- c("sex", "married", "age", "havejob", "educ", "political.afl",
"rural", "region", "fin.intermdiaries", "fin.knowldge", "income")
BchMk.GLM <- GLM_Model(sample_data, c(xvar, "networth"), yvar )
BchMk.GLM$finalModel
BchMk.GLM$Roc$auc

pomodoro documentation built on March 26, 2022, 5:05 p.m.