4
How to issue the discriminant function constant (or constants, if multiple discriminant analysis)? Follows the dput
for assistance in response.
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")
Where: REAÇÃO
is the dependent variable and the other independent variables.
As it is a simple discriminant analysis (two groups), it will have only one statement for the only function of the model. Of an advance, this constant has the value of -4.438
. Preferably, I ask that it be obtained with a simple function to be executed.
Hello Giovani, post only the analysis output does not help much to understand what you need, the question becomes abstract, try to be a little more specific with a sample of your data and the analysis you performed. Use the command
dput(dados)
to capture a reproducible sample of your data and edit the question.– Thiago Fernandes
Hello, Fernandes. This post helps to understand my problem (get the constants in the discriminant analysis). However, the respondent did not provide the answer in script. See: https://stats.stackexchange.com/questions/166942/why-are-discriminant-analysis-results-in-r-lda-and-spss-different-constant-t
– neves
So, as the boy mentioned, in the MASS package, there is no such constant, but it suggests a way to get it through a mathematical equation, just understand the concept and implement in R.
– Thiago Fernandes
@Fernandes, I edited the question. If you can help me, thank you.
– neves
Unfortunately I won’t be able to help you, at least not now, but try to look at the function
PROC DISCRIM
of SAS, the concept is the same to obtain the constant, one can use the PDF as an aid.– Thiago Fernandes