ordinal regression

greetings i have some issues with my code, it gives me no output, am trying to run for each additional variable an ordinal regression and get the AIC but I have no value, thanks in advance for your help

library(MASS)
library(AICcmodavg)
AIC = numeric()
model_selection = function(matrix_baseline,matrix_selection){
  matrix_selection = na.omit(matrix_selection)
  matrix_baseline = na.omit(matrix_baseline)
  for(i in 1:23){
  #col_name <- matrix_selection[,i]
  model <- polr(HV270 ~ HV10601 + HV115 + HV024 + HV025 + HV009 + HV220 + matrix_selection[,i] , weights = wt, data = matrix_baseline)
  AIC[i] <- AICc(model)
  }
  return(AIC)
}

functions need to be run with parameters passed in before any output would be expected.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.