当前位置:网站首页>R language GLM generalized linear model: logistic regression, Poisson regression fitting mouse clinical trial data (dose and response) examples and self-test questions
R language GLM generalized linear model: logistic regression, Poisson regression fitting mouse clinical trial data (dose and response) examples and self-test questions
2022-07-25 13:07:00 【51CTO】
In fitting GLM( And check the residuals ) after , have access to z Test - test the significance of the estimated parameters , Compare the estimated value with its standard error .
GLM Examples of model fitting and analysis
Example 1. Mouse data GLM modeling ( Dose and response )
a) We input data and fit logistic regression models .





Model :

It can be compared with the complete model . And deviation value 17.639 dependent P value 0.82(> 0.10) This means that there is no significant evidence to reject the fitted model .



The empty model does not contain predictive variables , stay 25 A degree of freedom (df) The deviation on is 35.89. When the covariate x When adding to an empty model , The variation of deviation is 35.890-17.639=18.25. And the degree of freedom is 25-24=1 Chi square distribution of , Its P The value is 1.93 × 10 -5 Very remarkable .
Therefore, the model cannot be deleted x To simplify the .x Of the coefficient of t Inspection is also important (P value 0.0065<0.01).
Intercept ? Can you delete it ?

chart 1: Logistic regression of mouse data and fitting values .
b) We fit a model with probabilistic links .



Supporting model :

Again , Both of these parameters are important (P value <0.01)


add to x The variation of time deviation is significant (P value =

).
The model cannot be deleted x To simplify the .

chart 2: Mouse data and fitting values ( Dotted line : Probabilistic Links ).
Use probit Linked models are slightly better than using logit Linked models , Because the deviation is smaller . In two models ,x The coefficients of are significant (P value <0.01), This means that the effect increases as the dose increases .
Example 2. Clinical trial data ( Dose and response ) Of GLM modeling .
a) We input data , Then fit the logistic regression model





And deviation value 13.633 dependent P The value is 0.034<0.05.5% The level of rejection fits the model .
in the light of x Plotting residuals reveals a dependency pattern .

chart 3: Only with x The residual diagram of the fitting model .
So we're going to x2 Add to model .



Deviation from 13.633 Reduced to 5.107, Not significant (P value =0.403>0.05).
therefore , We cannot reject this model through evidence of bias .

chart 4: with x2 The residual diagram of the fitting model .
The residuals now look random .
The fitting model is

And all parameter estimates are significant (5%). Logarithmic probability

Depend on in a quadratic way x.
Example 3. AIDS data , Poisson
a) We input the data and use the default logarithmic link to fit the Poisson regression model .




deviation 29.654 Of P The value is 0.005<0.01 ⇒ Model rejected .

chart 5: Fitting model 3
Residual diagram of b) For year index x The residual graph of shows the dependency pattern . So we add

.

16.371 The deviation of (P The value is 0.1279>0.10) Not significant . Fitting model

You can't refuse on the ground of deviation . But the residual plot shows only slightly more random patterns than before .

chart 6: Fitting model 3 And x2 Residual diagram of
The model can be improved by using non canonical links .

Residual error of fitting model y = (-0.27571 +0.49277x)2 + e Shows a more random pattern .12 df The deviation in 16.905 Slightly higher than the previous model 16.371(df=11), But still not significant (P value =0.1532>0.10).AIC smaller , by 73.833<75.298. therefore , Models with square root links are preferred .
Constant items can be deleted (“ intercept ”) Do you ?
What other linking functions are available ?

Self test questions :
Twenty tobacco budworm moths of each sex were exposed to different doses of the insecticide trans-cypermethrin. The numbers of budworm moths killed during a 3-day exposure were as follows for each sex (male, female) and dose level in mg’s.

Type the data into R as follows. Press Enter at the end of each line including blank lines.
Fit two models by doing the following.
You may also run the following lines and refer to the chi-square distribution table
1. What model is fitted in fit1? Write it formally and define all the terms.
2. How is the model in fit2 differ from that in fit1?
3. Does the model in fit1 fit the data adequately? Use deviance to answer this question.
4. Can the model in fit1 be simplified to the model in fit2? Use change in deviance to answer
this question.
5. Can sex be removed from the model in fit2? Use change in deviance to answer this ques
tion.
6. What are the maximum likelihood estimates of the parameters of the additive model? What
are their standard errors? Test the significance of each parameter using its estimate and
standard error.
7. How does the probability of a kill change with log dose and sex of the budworm moth accord
ing to the additive model?
(a) Derive the survival function S(t) of a lifetime T » E xp(‚). Find ¡logS(t) and comment on it.
(b) Calculate the Kaplan-Meier estimate for each group in the following.
Treatment Group:
6,6,6,6*,7,9*,10,10*,11*,13,16,17*,19*,20*,22,23,25*,32*,32*,34*,35
Control Group (no treatment):
1,1,2,2,3,4,5,5,8,8,8,8,11,11,12,15,17,22,23
Note that * indicates right censored data.
(c) Use the log rank test to compare the two groups of lifetimes.

边栏推荐
- Vim技巧:永远显示行号
- 零基础学习CANoe Panel(14)——二极管( LED Control )和液晶屏(LCD Control)
- [rust] reference and borrowing, string slice type (& STR) - rust language foundation 12
- [CSDN year-end summary] end and start, always on the way - "2021 summary of" 1+1= Wang "
- EMQX Cloud 更新:日志分析增加更多参数,监控运维更省心
- 485 communication (detailed explanation)
- 【CSDN 年终总结】结束与开始,一直在路上—— “1+1=王”的2021总结
- [problem solving] org.apache.ibatis.exceptions PersistenceException: Error building SqlSession. 1-byte word of UTF-8 sequence
- MySQL remote connection permission error 1045 problem
- Emqx cloud update: more parameters are added to log analysis, which makes monitoring, operation and maintenance easier
猜你喜欢

R语言GLM广义线性模型:逻辑回归、泊松回归拟合小鼠临床试验数据(剂量和反应)示例和自测题

Common operations for Yum and VIM

clickhouse笔记03-- Grafana 接入ClickHouse

Shell常用脚本:获取网卡IP地址

Shell常用脚本:判断远程主机的文件是否存在

The larger the convolution kernel, the stronger the performance? An interpretation of replknet model

Shell常用脚本:检测某域名、IP地址是否通

ECCV2022 | TransGrasp类级别抓取姿态迁移

2022 年中回顾 | 大模型技术最新进展 澜舟科技

【历史上的今天】7 月 25 日:IBM 获得了第一项专利;Verizon 收购雅虎;亚马逊发布 Fire Phone
随机推荐
Mysql 远程连接权限错误1045问题
Business visualization - make your flowchart'run'(3. Branch selection & cross language distributed operation node)
零基础学习CANoe Panel(12)—— 进度条(Progress Bar)
[problem solving] org.apache.ibatis.exceptions PersistenceException: Error building SqlSession. 1-byte word of UTF-8 sequence
[problem solving] ibatis.binding BindingException: Type interface xxDao is not known to the MapperRegistry.
2022 年中回顾 | 大模型技术最新进展 澜舟科技
Software testing interview question: Please list the testing methods of several items?
A hard journey
感动中国人物刘盛兰
Use of Spirng @conditional conditional conditional annotation
Clickhouse notes 03-- grafana accesses Clickhouse
Substance Designer 2021软件安装包下载及安装教程
What is ci/cd?
微软提出CodeT:代码生成新SOTA,20个点的性能提升
State mode
Shell常用脚本:判断远程主机的文件是否存在
【AI4Code】《InferCode: Self-Supervised Learning of Code Representations by Predicting Subtrees》ICSE‘21
业务可视化-让你的流程图'Run'起来(3.分支选择&跨语言分布式运行节点)
Migrate PaloAlto ha high availability firewall to panorama
JS sorts according to the attributes of the elements in the array