2013-07-24 16:05:15 8 Comments

I'm experiencing some trouble when using the polr function.

Here is a subset of the data I have:

```
# response variable
rep = factor(c(0.00, 0.04, 0.06, 0.13, 0.15, 0.05, 0.07, 0.00, 0.06, 0.04, 0.05, 0.00, 0.92, 0.95, 0.95, 1, 0.97, 0.06, 0.06, 0.03, 0.03, 0.08, 0.07, 0.04, 0.08, 0.03, 0.07, 0.05, 0.05, 0.06, 0.04, 0.04, 0.08, 0.04, 0.04, 0.04, 0.97, 0.03, 0.04, 0.02, 0.04, 0.01, 0.06, 0.06, 0.07, 0.08, 0.05, 0.03, 0.06,0.03))
# "rep" is discrete variable which represents proportion so that it varies between 0 and 1
# It is discrete proportions because it is the proportion of TRUE over a finite list of TRUE/FALSE. example: if the list has 3 arguments, the proportions value can only be 0,1/3,2/3 or 1
# predicted variable
set.seed(10)
pred.1 = sample(x=rep(1:5,10),size=50)
pred.2 = sample(x=rep(c('a','b','c','d','e'),10),size=50)
# "pred" are discrete variables
# polr
polr(rep~pred.1+pred.2)
```

The subset I gave you works fine ! But my entire data set and some subset of it does not work ! And I can't find anything in my data that differ from this subset except the quantity. So, here is my question: Is there any limitations in terms of the number of levels for example that would yield to the following error message:

```
Error in optim(s0, fmin, gmin, method = "BFGS", ...) :
the initial value in 'vmin' is not finite
```

and the notification message:

```
glm.fit: fitted probabilities numerically 0 or 1 occurred
```

(I had to translate these two messages into english so they might no be 100% correct)

I sometimes only get the notification message and sometimes everything is fine depending on the what subset of my data I use.

My rep variable have a total of 101 levels for information (and contain nothing else than the kind of data I described)

So it is a terrible question that I am asking becaue I can't give you my full dataset and I don't know where is the problem. Can you guess where my problem comes from thanks to these informations ?

**Thank you**

### Related Questions

#### Sponsored Content

#### 2 Answered Questions

#### 1 Answered Questions

### Ordinal Logistic Regression In R

**2019-03-29 11:10:23****Unknown****626**View**0**Score**1**Answer- Tags: r regression

#### 9 Answered Questions

### [SOLVED] Difference between InvariantCulture and Ordinal string comparison

**2009-01-29 18:21:45****Kapil****134410**View**536**Score**9**Answer- Tags: c# .net string-comparison ordinal

#### 1 Answered Questions

### [SOLVED] Can MICE pool results of ordinal logistic regression run by the function polr()?

**2018-07-21 07:18:07****d.lee****412**View**0**Score**1**Answer- Tags: r logistic-regression glm ordinal r-mice

#### 1 Answered Questions

### [SOLVED] Understanding errors from ordinal logistic regression

**2016-06-06 21:59:15****Carl****226**View**0**Score**1**Answer- Tags: r regression logistic-regression ordinal

#### 1 Answered Questions

#### 1 Answered Questions

### [SOLVED] Baum-Welch algorithm showing Log-likelihood: NaN BIC criterium: NaN AIC criterium: NaN

**2016-02-03 05:21:03****Azam****616**View**1**Score**1**Answer- Tags: r gaussian hidden-markov-models

## 2 comments

## @Johan Larsson 2016-03-14 08:51:35

`orm`

from`rms`

can handle ordered outcomes with a large number of categories.## @David Marx 2013-07-24 16:35:53

Following @joran's advice that your problem is probably the 100-level factor, I'm going to recommend something that probably isn't statistically valid but will probably still be effective in your particular situation: don't use logistic regression at all. Just drop it. Perform a simple linear regression and then discretize your output as necessary using a specialized rounding procedure. Give it a shot and see how well it works for you.