R 线性判别分析中常数项的求法

R 线性判别分析中常数项的求法,r,linear-discriminant,R,Linear Discriminant,考虑dputdput: structure(list(REAÇÃO = structure(c(0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1), format.spss = "F11.0"), IDADE = structure(c(22, 38, 36, 58, 37, 31, 32, 54, 60, 34, 45, 27

考虑dput
dput

structure(list(REAÇÃO = structure(c(0, 1, 0, 0, 1, 0, 1, 1, 
0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 
1, 0, 1, 1, 0, 1, 1), format.spss = "F11.0"), IDADE = structure(c(22, 
38, 36, 58, 37, 31, 32, 54, 60, 34, 45, 27, 30, 20, 30, 30, 22, 
26, 19, 18, 22, 23, 24, 50, 20, 47, 34, 31, 43, 35, 23, 34, 51, 
63, 22, 29), format.spss = "F11.0"), ESCOLARIDADE = structure(c(6, 
12, 12, 8, 12, 12, 10, 12, 8, 12, 12, 12, 8, 4, 8, 8, 12, 8, 
9, 4, 12, 6, 12, 12, 12, 12, 12, 12, 12, 8, 8, 12, 16, 12, 12, 
12), format.spss = "F11.0"), SEXO = structure(c(1, 1, 0, 0, 1, 
0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 
0, 1, 0, 1, 0, 0, 0, 1, 1, 1), format.spss = "F11.0")), .Names = c("REAÇÃO", 
"IDADE", "ESCOLARIDADE", "SEXO"), row.names = c(NA, -36L), class = "data.frame")
其中:
REAÇO
是模型中的因变量

常数:
-4.438


如何使用R中的简单函数获得该值?

用于在R(具有库质量)的判别分析中获得常数项:

groupmean<-(model$prior%*%model$means)
constant<-(groupmean%*%model$scaling)
constant
model<-lda(y~x1+x2+xn,data=mydata)
model