Learn R Programming

pomodoro (version 3.8.0)

GLM_Model: 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.

Value

The output from GLM_Model.

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,\ldots,n\) and \(j=1,\ldots,p\) characteristics of the applicants. The log-odds can be define as:

$$log(\frac{\pi_{i}}{1-\pi_{i}}) = \beta_{0}+\bold{x}_{\bold{i}}\beta = \beta_{0}+\sum_{i=1}^{p}\beta_{i}\bold{x}_{i}$$

\(\beta_{0}\) is the intercept, \(\beta = (\beta_{1},\ldots, \beta_{p})\) is a \(p\) \(x\) \(1\) vector of coefficients and \(\bold{x_{i}}\) is the \(i_{th}\) row of x.

Examples

Run this code
# NOT RUN {
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
# }

Run the code above in your browser using DataLab