glm表示广义线性回归,data表示y,x1,x2所在的数据集,family中的link用来选择回归类型,logit表示选择logistic回归
R 里 是 Logit 变换 -- Logit Transformation计算 比例 或 百分之比 (lambda) 的 Logit 变换
用法:
logit(p, percents=max(p, na.rm = TRUE) >1, adjust)
参数:
p- 比例 或 百分之比 向量 或数组。
percents -- TRUE 表示 用 百分比。
adjust -- 调整因子 ,避免比例为 0或1, 默认没这个比例时 为 0时, 有这个比例 为 .025
例子:
options(digits=4)
logit(.1*0:10)
## [1] -3.6636 -1.9924 -1.2950 -0.8001 -0.3847 0.0000 0.3847
## [8] 0.8001 1.2950 1.9924 3.6636
## Warning message:
## Proportions remapped to (0.025,0.975) in: logit(0.1 * 0:10)