In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to understand Poisson regression in R language. the content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.
Poisson regression is a very useful tool when predicting counting result variables through a series of continuous and or category prediction variables. Use robust package to learn and understand Poisson regression.
Data were collected on the age and incidence of epilepsy in patients with mild or severe intermittent epilepsy, including the first eight weeks before and within eight weeks after the patient was randomly assigned to the drug group or placebo group. The response variable was sumY (the number of seizures in the last eight weeks), and the predictive variables were treatment conditions (Trt), age (Age) and the number of basic seizures in the first eight weeks (Base). The next step is to study whether drug treatment can reduce the incidence of epilepsy.
Data (breslow.dat,package= "robust")
> library (robust)
Load the required program package: fit.models
> names (breslow.dat)
[1] "ID", "Y1", "Y2", "Y3", "Y4", "Base", "Age", "Trt", "Ysum", "sumY", "Age10" # there are 12 variables
[12] "Base4"
> summary (breslow. Data [c (6, 7, 8, 10)]) # only describes Base, Age, etc.
Base Age Trt sumY
Min. : 6.00 Min. : 18.00 placebo: 28 Min. : 0.00
1st Qu.: 12.00 1st Qu.:23.00 progabide:31 1st Qu.: 11.50
Median: 22.00 Median: 28.00 Median: 16.00
Mean: 31.22 Mean: 28.34 Mean: 33.05
3rd Qu.: 41.00 3rd Qu.:32.00 3rd Qu.: 36.00
Max. : 151.00 Max. : 42.00 Max. : 302.00
> opar par (mfrow=c (1J2))
> attach (breslow.dat)
> hist (sumY,breaks = 20 main= xlabs = "Seazure Count", main= "Distribution of Seizures")
> boxplot (sumY ~ Trt,xlab= "Trearment", main= "Group Comparisons")
> par (opar)
> fit summary (fit)
Call:
Glm (formula = sumY ~ Base + Age + Trt, family = poisson (), data = breslow.dat)
Deviance Residuals:
Min 1Q Median 3Q Max
-6.0569-2.0433-0.9397 0.7929 11.0061
Coefficients:
Estimate Std. Error z value Pr (> | z |)
(Intercept) 1.9488259 0.1356191 14.370
< 2e-16 *** Base 0.0226517 0.0005093 44.476 < 2e-16 *** Age 0.0227401 0.0040240 5.651 1.59e-08 *** Trtprogabide -0.1527009 0.0478051 -3.194 0.0014 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 (Dispersion parameter for poisson family taken to be 1) Null deviance: 2122.73 on 58 degrees of freedom Residual deviance: 559.44 on 55 degrees of freedom AIC: 850.71 Number of Fisher Scoring iterations: 5 运行过程中产生的图片: #解释参数: >Coef (fit)
(Intercept) Base Age Trtprogabide
1.94882593 0.02265174 0.02274013-0.15270095
> exp (coef (fit))
(Intercept) Base Age Trtprogabide
7.0204403 1.0229102 1.0230007 0.8583864
So much for sharing about how to understand Poisson regression in R language. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.