@@ -147,7 +147,7 @@ mlClassificationLogisticMultinomial <- function(jaspResults, dataset, options, .
147
147
table $ addColumnInfo(name = " var" , title = " " , type = " string" )
148
148
table $ addColumnInfo(name = " coefs" , title = gettextf(" Coefficient (%s)" , " \u 03B2" ), type = " number" )
149
149
table $ addColumnInfo(name = " se" , title = gettext(" Standard Error" ), type = " number" )
150
- table $ addColumnInfo(name = " t " , title = gettext(" t " ), type = " number" )
150
+ table $ addColumnInfo(name = " z " , title = gettext(" z " ), type = " number" )
151
151
table $ addColumnInfo(name = " p" , title = gettext(" p" ), type = " pvalue" )
152
152
if (options [[" coefTableConfInt" ]]) {
153
153
overtitle <- gettextf(" %1$s%% Confidence interval" , round(options [[" coefTableConfIntLevel" ]] * 100 , 3 ))
@@ -169,10 +169,8 @@ mlClassificationLogisticMultinomial <- function(jaspResults, dataset, options, .
169
169
classificationResult <- jaspResults [[" classificationResult" ]]$ object
170
170
model <- classificationResult [[" model" ]]
171
171
if (classificationResult [[" family" ]] == " binomial" ) {
172
- coefs <- summary(model )$ coefficients
173
- conf_int <- confint(model , level = options [[" coefTableConfIntLevel" ]])
174
- coefs <- cbind(coefs , lower = conf_int [, 1 ], upper = conf_int [, 2 ])
175
- colnames(coefs ) <- c(" est" , " se" , " t" , " p" , " lower" , " upper" )
172
+ coefs <- cbind(coef(summary(model )), confint(model , level = options [[" coefTableConfIntLevel" ]]))
173
+ colnames(coefs ) <- c(" est" , " se" , " z" , " p" , " lower" , " upper" )
176
174
vars <- rownames(coefs )
177
175
for (i in seq_along(vars )) {
178
176
if (! (vars [i ] %in% options [[" predictors" ]]) && vars [i ] != " (Intercept)" ) {
@@ -184,8 +182,8 @@ mlClassificationLogisticMultinomial <- function(jaspResults, dataset, options, .
184
182
}
185
183
rownames(coefs ) <- vars
186
184
} else {
187
- coefs <- cbind(model $ coefficients , confint(model [[" original" ]], level = options [[" coefTableConfIntLevel" ]]))
188
- colnames(coefs ) <- c(" est" , " lower" , " upper" )
185
+ coefs <- cbind(VGAM :: coef( VGAM :: summaryvglm( model [[ " original " ]])) , confint(model [[" original" ]], level = options [[" coefTableConfIntLevel" ]]))
186
+ colnames(coefs ) <- c(" est" , " se " , " z " , " p " , " lower" , " upper" )
189
187
vars <- rownames(coefs )
190
188
for (i in seq_along(vars )) {
191
189
for (j in c(" (Intercept)" , options [[" predictors" ]])) {
@@ -206,16 +204,9 @@ mlClassificationLogisticMultinomial <- function(jaspResults, dataset, options, .
206
204
}
207
205
table [[" var" ]] <- rownames(coefs )
208
206
table [[" coefs" ]] <- as.numeric(coefs [, " est" ])
209
- if (classificationResult [[" family" ]] == " binomial" ) {
210
- table [[" se" ]] <- as.numeric(coefs [, " se" ])
211
- table [[" t" ]] <- as.numeric(coefs [, " t" ])
212
- table [[" p" ]] <- as.numeric(coefs [, " p" ])
213
- } else {
214
- table [[" se" ]] <- rep(" ." , nrow(coefs ))
215
- table [[" t" ]] <- rep(" ." , nrow(coefs ))
216
- table [[" p" ]] <- rep(" ." , nrow(coefs ))
217
- table $ addFootnote(gettext(" Standard errors, t-values and p-values are not available in multinomial regression." ))
218
- }
207
+ table [[" se" ]] <- as.numeric(coefs [, " se" ])
208
+ table [[" z" ]] <- as.numeric(coefs [, " z" ])
209
+ table [[" p" ]] <- as.numeric(coefs [, " p" ])
219
210
if (options [[" coefTableConfInt" ]]) {
220
211
table [[" lower" ]] <- coefs [, " lower" ]
221
212
table [[" upper" ]] <- coefs [, " upper" ]
0 commit comments