Welcome to visit Zhongnan Medical Journal Press Series journal website!

Home Articles Vol 36,2023 No.3 Detail

Implementation of generalized linear model in Python

Published on Apr. 07, 2023Total Views: 2043 times Total Downloads: 622 times Download Mobile

Author: Chen-Xi LUO Qing-Yu ZHANG Xiang-Ying LI Pei-Zheng LI Jing WANG Lu MA

Affiliation: School of Public Health, Wuhan University, Wuhan 430071, China

Keywords: Python SAS R Generalized linear model Statistical analysis

DOI: 10.12173/j.issn.1004-4337.202302030

Reference: Luo CX, Zhang QY, Li XY, Li PZ, Wang J, Ma L. Implementation of generalized linear model in Python[J]. Journal of Mathematical Medicine, 2023, 36(3): 161-165. DOI: 10.12173/j.issn.1004-4337.202302030[Article in Chinese]

  • Abstract
  • Full-text
  • References
Abstract

Objective  To explore the implementation method of generalized linear model in Python software, and compare its process and results with other common statistical software.

Method  Using GLM function, Logit and Poisson function in statsmodles library of Python software, GLM function in R software and PROC GENMOD procedure step of SAS, the binomial distribution and Poisson distribution data sets were analyzed, and the process and analysis results of the three software algorithms were compared.

Results  The logic of the three kinds of software to construct the generalized linear model is similar, but the software is slightly different in code implementation, model fitting methods and other aspects, and the results of the software are basically the same.

Conclusion  Python softwares can use different algorithms to build generalized linear models, and can provide the same statistical analysis conclusions as other mainstream statistical softwares.

Full-text
Please download the PDF version to read the full text: download
References

1.陈希孺. 广义线性模型(一)[J].数理统计与管理, 2002, 21(5): 54-61. [Chen XR. Generalized linear mod-el(I)[J]. Journal of Applied Statistics and Management, 2002, 21(5): 54-61.] DOI: 10.3969/j.issn.1002-1566.2002.05.013.

2.陈希孺.广义线性模型(五)[J].数理统计与管理, 2003(3): 56-63. [Chen XR. Generalized linear model (V)[J]. Journal of Applied Statistics and Management. 2003, 22(3): 56-63.] DOI: 10.3969/j.issn.1002-1566.2003.03.014.

3.Perkel JM. Programming: pick up python[J]. Nature, 2015, 518(7537): 125-126. DOI: 10.1038/518125a.

4.顾刘金, 陈钢. 广义线性模型及SPSS软件实现[J]. 预防医学, 2020, 32(7): 755-756. [Gu LJ, Chen G. Gen-eralized linear model and SPSS software implementation[J]. Journal of Preventive Medicine, 2020, 32(7): 755-756.] DOI: 10.19485/j.cnki.issn2096-5087.2020.07.028.

5.Moore LM. Statistical modelling in GLIM[J]. Technometrics, 1991, 33: 109-110. DOI: 10.1080/ 00401706.1991.10484778.

6.Mccullagh P, Nelder JA. Generalized linear models. Monographs on statistics and applied probability No 37[M]. 1989. https://xueshu.baidu.com/usercenter/paper/show?paperid=4001f961ce14e854685ae652368244ad&site=xueshu_se&hitarticle=1.

7.Kyung M, Gill J, Ghosh M, et al. Jeff Gill. Generalized linear models: a unified approach. 2000, sage QASS se-ries. Ken Meier and Jeff Gill. What works: a new approach to program and policy analysis. 2000. https://xueshu.baidu.com/usercenter/paper/show?paperid=ccda165d8e9e175e01b8241a32cf3c3b&site=xueshu_se.

8.焦奎壮, 马煦晰, 马小茜, 等. 广义估计方程与混合线性模型在Python中的实现[J].医学新知, 2022, 32(05): 333-338. [Jiao KZ,  Ma XX,  Ma XQ, et al. Implementation of generalized estimating equations and mixed linear models in Python[J]. New Medicine, 2022, 32(5): 333-338.] DOI: 10.12173/j.issn.1004-5511.202203007.

9.刘正. 积木式python编程系统的研究与实现[D].北京邮电大学, 2020. [Liu Z. Research and implementa-tion of Block-Python programming system[D]. Beijing University of Posts and Telecommunications, 2020.] DOI: 10.26969/d.cnki.gbydu.2020.002202.

10.卢绍兵. 基于Python的混合语言编程及其实现研究[J].科技资讯, 2022, 20(14): 31-33. [Lu SB. Reseach on mixed language programming based on Python and its implementation[J]. Science & Technology Infor-mation, 2022, 20(14): 31-33.] DOI: 10.16661/j.cnki.1672-3791.2201-5042-7709.

Popular papers
Last 6 months