|
Returns the variance-covariance matrix of the main parameters of a fitted model object.
建立好一个模型后,需要求其参数的协方差矩阵怎么办。
大家可以通过使用下面的函数还获取
vcov(object, ...)
Arguments
object a fitted model object.
... additional arguments for method functions. For the glm method this can be used to pass a dispersion parameter.
例子
#数据
mydata <- read.csv(url("http://www.ats.ucla.edu/stat/r/dae/binary.csv"))
attach(mydata)
names(mydata)
[1] "admit" "gre" "gpa" "rank"
#logistic回归拟合
mylogit<- glm(admit~gre+gpa+as.factor(rank), family=binomial(link="logit"), na.action=na.pass)
##协方差矩阵
Sigma=vcov(mylogit),
|
|