0

I'm using the ordinalNet package in R for prediction.

My Dataset has 51 Variables and 160k observations.

In the ordinalNet() function, x has to be a covariate matrix and y has to be a factor.

If I interchange the X as a covariate matrix, it will have 51 rows and 51 columns. The response variable has 160k observations, so it's showing an error due to mismatched dimensions.

fit_exp<-ordinalNet(x, y, family="cumulative", link="logit")

**Error in ordinalNet(x, y, family = "cumulative", link = "logit") : 
  x and y dimensions do not match.**

How should I approach this differently? I'm new to R.

Arun
  • 1
  • 3
  • Please read: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – De Novo Mar 26 '18 at 06:25
  • How that post applies here: the first step to answering this is trying to reproduce the same error with a smaller data set, or a data set that comes with base r. Then, if that hasn't solved your question, post the example that reproduces the error. – De Novo Mar 26 '18 at 06:34

1 Answers1

0

The error message explains by itself:

x and y dimensions do not match.

You can check your x and y dimensions with:

nrow(x) ; length(y)
Y. Z.
  • 369
  • 2
  • 16