'R: Effects Plot, Ordinal Regression: In regularize.values(x, y, ties, missing(ties)) :
I am trying to visualize the probabilities of a simple ordinal regression:
model4<-polr(as.factor(Cycle)~VarS,data=data,Hess=TRUE), where Cycle is the frequency of cycling/week and VarS an independent variable ranging from 1-4. There are no NA values in either.
plot(Effect(focal.predictors = c("VarS"), model4)) throws
Warning messages:
1: In effect.llines(x[good], y[good], lwd = lwd, lty = lty, col = colors[1], :
spline interpolation may be unstable with only 1 points
2: In effect.llines(x[good], y[good], lwd = lwd, lty = lty, col = colors[1], :
spline interpolation may be unstable with only 3 points
3: In effect.llines(x[good], y[good], lwd = lwd, lty = lty, col = colors[1], :
spline interpolation may be unstable with only 3 points
4: In effect.llines(x[good], y[good], lwd = lwd, lty = lty, col = colors[1], :
spline interpolation may be unstable with only 1 points
5: In effect.llines(x[good], y[good], lwd = lwd, lty = lty, col = colors[1], :
spline interpolation may be unstable with only 4 points
6: In regularize.values(x, y, ties, missing(ties)) :
collapsing to unique 'x' values
The resulting plot looks strange:
I tried plot(Effect(focal.predictors = c("VarS",model4), xlevels = list(VarS = 1:4))) but that throws Error in model.frame.default(as.factor(Cycle) ~ VarS + VarS, data = list( : variable lengths differ (found for 'VarS')
(note the "VarS + VarS")
A multiline plot with the same data looks just fine (also the stacked version looks OK): Multiline
Any hints on what I am doing wrong?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
