Article Timeliness Reminder
It has been 994 days since the last update, the content may be outdated.
有序分类Logistic回归
Logistic回归的假设
- 假设1:因变量唯一,且为有序多分类变量
- 假设2:存在一个或多个自变量,可为连续、有序多分类或无序分类变量。
- 假设3:自变量之间无多重共线性。
- 假设4:模型满足“比例优势”假设。
通过conda安装纯净环境的Logistic分析包
- conda create -n logistic -c conda-forge r-base=4.1.3
- conda activate logistic
- conda install -c conda-forge r-tidyverse=1.3.1 -y
- conda install -c conda-forge r-irkernel -y
- conda install -c conda-forge r-foreign -y
- conda install -c conda-forge r-mass -y
- conda install -c conda-forge r-hmisc -y
- conda install -c conda-forge r-reshape2 -y
- conda install -c r r-car -y
- Rscript -e “IRkernel::installspec(name=’logistic’, displayname=’r-logistic’)”
准备数据
1 |
|
多重共线性检测
- qr(as.matrix(df[1:10]))$rank == 10
- kappa(cor(as.matrix(df[1:10])), exact= TRUE) < 100
- library(car)
- vif(lm.sol)
Logistic回归
1 |
|
绘制森林图
1 |
|
有序分类Logistic回归
https://occdn.limour.top/2099.html