I am trying to perform an simple ordinal logistic regression in R.
I have loaded these libraries :
library(ordinal)
library(readxl)
library(rcompanion)
library(foreign)
library(ggeffects)
library(ggiraph)
library(predict3d)
Here are the codes that I typed so far :
data <- read_excel(“C:/Users/*****/OneDrive/Documents/Applied Econometrics/AppEcon/DATA/Adult.Dataset.xlsx”)
data
data$INCOME_GREATER_THAN_50K_CODE <- factor(data$INCOME_GREATER_THAN_50K_CODE, ordered=TRUE)
model_clm1 <- clm(INCOME_GREATER_THAN_50K_CODE ~ EDUCATION_CODE, data = data)
summary(model_clm1)
nagelkerke(model_clm1)
AIC(model_clm1)
BIC(model_clm1)
ggpredict(model_clm1, terms = “EDUCATION_CODE[5,10,13]”)
I restarted my R session and installed these packages :
library(ggeffects)
library(ggiraph)
library(predict3d)
However, when I typed “ggpredict(model_clm1, terms = “EDUCATION_CODE[5,10,13]”),” this is the error message that prompts :
Error in h(simpleError(msg, call)) :
error in evaluating the argument ‘x’ in selecting a method for function ‘diag’: “crossprod” is not a BUILTIN function
My desired output when I type “ggpredict(model_clm1, terms = “EDUCATION_CODE[5,10,13]”)” is this :
enter image description here
Matthew Salang is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.