cancel
Showing results for 
Search instead for 
Did you mean: 

Change Variable Type to an ordinal Factor

Former Member
0 Kudos

Hello everyone,

I am trying to perform a multinomial ordinal logistic regression on a data set with the MASS R package. I created an R-Component but I don t know how to change my dependent numeric variable into an ordinal factor.  Therefore I also created an data transformation R-Component which shows no error when compiled, but the desired transformation is not happening. Here is the code of the R-Component I used.

doFactor <- function(data, x){

  pos <- names(data) == as.character(x)

  data[,pos] <- as.factor(data[,pos])

  out <- data

  return(list(result = out) )

}

Any suggestion would be much appreciated.

Best Regards,

Viktor

Accepted Solutions (1)

Accepted Solutions (1)

AndreasForster
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Viktor,

It sounds like the "Data Type Definition" from the standard functionality might help? It allows you to change the variable type, ie from integer to string.

Many Greetings

Andreas

Answers (1)

Answers (1)

achab
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Viktor, is your problem resolved?