广义线性模型(Generalized linear model)

终于,对该concept有了一个初步且较为完整的理解了!本文为学习医咖会小课堂中《广义线性模型-stata教程》记录。

对于数学原理,我没有深究,主要目的是为了理解glm是个啥?

广义线性模型(Generalized linear model)_第1张图片

在广义线性模型中,相比简单线性模型,这是对因变量Y进行了变换,使变换后的Y和X呈线性关系

分类:简单广义线性回归(simple glm);多元广义线性回归(multiple glm)

其中,X可以是各种类型的变量(连续、分类)

广义线性模型(Generalized linear model)_第2张图片

需要考虑的两个问题,如上图所示。平时使用的linear regression, logistic regression, poisson regression, log-binomial regression等都属于glm的范畴。常用的方法,所对应的family和link如下表所示

广义线性模型(Generalized linear model)_第3张图片

具体而言

 

广义线性模型(Generalized linear model)_第4张图片

广义线性模型(Generalized linear model)_第5张图片

广义线性模型(Generalized linear model)_第6张图片

广义线性模型(Generalized linear model)_第7张图片

commonly used commands:

regress y x1 x2 x3 ...
logistic y x1 x2 x3 ...
poisson y x1 x2 x3 ...

# linear regression
regress price weight length mpg i.rep78
glm price weight length mpg i.rep78, family(gaussian) link(identity)

# logistic regression
logistic low age i.smoke i.race
glm low age i.smoke i.race, family(binomial) link(logit)
glm low age i.smoke i.race, family(binomial) link(logit) eform

以上为简要笔记~

你可能感兴趣的:(统计学)