LDA

Dimitrios Zacharatos

2025-02-12

This shows the output of LDA function from workingfunctions.
Installation instructions of workingfunctions can be found here https://github.com/sedzinfo/workingfunctions

Report LDA

model<-MASS::lda(case~.,data=infert)
result<-report_lda(model=model)
result
## $prior_counts
##       prior counts mean.education6.11yrs mean.education12..yrs mean.age mean.parity mean.induced mean.spontaneous mean.stratum mean.pooled.stratum
## 0 0.6653226    165             0.4848485             0.4666667 31.49091    2.084848    0.5636364        0.3878788     41.80606            33.52121
## 1 0.3346774     83             0.4819277             0.4698795 31.53012    2.108434    0.5903614        0.9518072     42.00000            33.69880
## 
## $means
##   education6-11yrs education12+ yrs      age   parity   induced spontaneous  stratum pooled.stratum
## 0        0.4848485        0.4666667 31.49091 2.084848 0.5636364   0.3878788 41.80606       33.52121
## 1        0.4819277        0.4698795 31.53012 2.108434 0.5903614   0.9518072 42.00000       33.69880
## 
## $coeficients
##                          LD1
## education6-11yrs  0.75022622
## education12+ yrs  2.04878231
## age               0.06296971
## parity           -0.45741902
## induced           1.16162261
## spontaneous       1.98017958
## stratum          -0.00185125
## pooled.stratum   -0.05209454
## 
## $terms
## case ~ education + age + parity + induced + spontaneous + stratum + 
##     pooled.stratum
## attr(,"variables")
## list(case, education, age, parity, induced, spontaneous, stratum, 
##     pooled.stratum)
## attr(,"factors")
##                education age parity induced spontaneous stratum pooled.stratum
## case                   0   0      0       0           0       0              0
## education              1   0      0       0           0       0              0
## age                    0   1      0       0           0       0              0
## parity                 0   0      1       0           0       0              0
## induced                0   0      0       1           0       0              0
## spontaneous            0   0      0       0           1       0              0
## stratum                0   0      0       0           0       1              0
## pooled.stratum         0   0      0       0           0       0              1
## attr(,"term.labels")
## [1] "education"      "age"            "parity"         "induced"        "spontaneous"    "stratum"        "pooled.stratum"
## attr(,"order")
## [1] 1 1 1 1 1 1 1
## attr(,"intercept")
## [1] 1
## attr(,"response")
## [1] 1
## attr(,".Environment")
## <environment: R_GlobalEnv>
## attr(,"predvars")
## list(case, education, age, parity, induced, spontaneous, stratum, 
##     pooled.stratum)
## attr(,"dataClasses")
##           case      education            age         parity        induced    spontaneous        stratum pooled.stratum 
##      "numeric"       "factor"      "numeric"      "numeric"      "numeric"      "numeric"      "numeric"      "numeric" 
## 
## $model_description
##   Observations      SDV
## 1          248 8.428289
## 
## $cmatrix
##          0     1    2    sum    p
## 0   146.00 42.00 0.00 188.00 0.78
## 1    19.00 41.00 0.00  60.00 0.68
## 2     0.00  0.00 0.00   0.00 0.00
## sum 165.00 83.00 0.00 248.00 1.00
## p     0.88  0.49 0.00   1.00 0.75
## 
## $call
##                              call
## 1 lda(formula=case~.,data=infert)