317 questions
0
votes
0
answers
40
views
How can I get the standard error of the standard deviation of the random intercept in a cumulative linear mixed model using "ordinal" package in R?
# A tibble: 7,500 × 4
cluster cluster_size x ordinal_y
<int> <int> <dbl> <fct>
1 1 1 2.57 4
2 1 2 3.59 4 ...
0
votes
0
answers
19
views
Why are the threshold coefficients of my cumulative link mixed model seemingly very large? [migrated]
I'm fitting a cumulative link mixed model with the ordinal package. The data is repeated measures (survey taken at three time points). The model converges without issue and the estimates look ...
0
votes
0
answers
34
views
"too large a matrix for LINPACK" when fitting a generalized ordered probit/logit model in R with large dataset
I'm working with a large dataset of around 5,000,000 observations, and I need to fit a generalized ordered probit or logit model using R. Here’s the code that I'm currently running:
library(dplyr)
...
0
votes
0
answers
14
views
Index construction for multivariate ordinal with known weights
Constructing a prioritization score from the following ordinal variables:
Last Visit [100,80,60,40,20,0]
Num Emp [100,0]
Year Established [100,80,60,40,20,0]
Last Exp [100,50,0]
Tier [100,66,33,0]
...
2
votes
1
answer
110
views
Finding confidence interval for response variables in ordinal logistic model
While working with private data, I noticed that the ordinal logistic model fitted using the polr function from the MASS package, along with the confidence intervals provided by broom::tidy, does not ...
0
votes
0
answers
166
views
clmm function gives me an error "Error in x$code == 0L || action == "silent" : Error 'length = 2' in coercion to 'logical(1)'"
The following commands regarding the two types of models are executed in R
model_4_clmm <- clmm(v27_3 ~ SEX_2 + AGE + PARTLIV_2 + EDULEVEL_2 + WORK_2 + ISCO08_2 + PARTY_LR_2 + v4_3 + gdp_per_capita....
0
votes
0
answers
40
views
How do I perform an ordered logistic regression with the R lme package?
I have longitudinal ordinal data and survival data. I want to do a joint model. I am familiar with the JM package, which uses lme for the longitudinal model. I theoretically understand that you can ...
0
votes
0
answers
25
views
Level probabilites from emmeans don't seem to match predicted means from emmeans
When I ask emmeans for model level probabilities I get the highest probabilities near levels 6 and 7 of my ordinal DV:enter image description here
> emmeans(clm_gid_no,
+ ~ value | ...
1
vote
0
answers
42
views
"cannot coerce type 'closure' to vector of type 'character'" - when running 'clmm' comand from "ordinal" package in R
I run a command from the paper "Multilevel Ordinal Logit Models: A Proportional Odds Application Using Data from Brazilian Higher Education Institutions" - from the supplementary material:
...
0
votes
0
answers
297
views
Fit Partial Proportional Odds Model (Ordered Logit) for Ordinal Response Variable with Big Dataset
I'm seeking advice regarding fitting a Generalized Ordered Logit model with a large dataset. My aim is to understand the effect of the variable "origin_country_code" on the dependent ...
0
votes
0
answers
45
views
Ordinal Encoding with 'unknown' Values
Subject: Question about Ordinal Encoding with 'unknown' Values in Education Levels
Hello community,I have a dataset and I'm planning to perform ordinal encoding on certain columns, particularly on the ...
0
votes
0
answers
120
views
How to deal with ordinal category when using SMOTENC?
I have 4 categorical features, one of which is ordinal. I think SMOTENC uses one-hot encoder for all features passed to categorial_features(). How do I deal with ordinal categories?
I'm currently ...
0
votes
1
answer
242
views
Is there a method in R that allows me to change my outcome variable to a factor after multiple imputation with mice, and then pool ordinal regression?
I have an outcome variable that represents the average of several Likert scale scores (0-7), and has been calculated to 1 decimal place. I did consider a linear regression, but it is really not ...
1
vote
0
answers
261
views
Trouble installing "ordinal" package
I cannot get the "ordinal" package to install, though all other packages will install just fine. I am using the latest version of R (no updates available, according to the "Check for ...
1
vote
1
answer
180
views
Ordinal + Continuous interaction in lavaan
I'm completing a moderation mediation analysis in lavaan.
All of my variables are continuous other than my mediator, which is an ordinal with 3 levels (0,1,2). Lavaan can't handle interactions between ...
0
votes
1
answer
70
views
Ceasar coding returns wrong characters
enter image description here
the issue I think is within the if statement('s) but I can't find the problem after tweaking for a bit.
txt = "xofob qyxxk qsfo iye ez, xofob qyxxk vod iye nygx"
...
0
votes
1
answer
101
views
cumulative probability at different levels of the response with emmeans
Given this model:
library(ordinal)
wine2 <- wine
wine2$rating[wine2$rating==5] <- 1
wine2$rating <- ordered(wine2$rating)
fm <- clm(rating ~ response*temp, data=wine2)
how can I ...
0
votes
0
answers
171
views
Mediation & Moderation w/ an Ordinal Variable in R package lavaan sem function (v0.6.16)
I have x1, x2, m, and y where m is an ordered three-level categorical variable. The model is as follows.
m ~ a*x1
y ~ cx1 + x2 + bm + x2:m
Since m is an ordinal variable, we cannot create this x2:m ...
0
votes
1
answer
624
views
Multiple imputation (MICE) to deal with missing values in ordinal variables
I am trying to replace missing values in 15 ordinal variables using MICE. The variables are on a 5-point scale (level of agreement scale) that I effects coded from -2 to 2.
I thought the appropriate ...
1
vote
0
answers
48
views
Different results in Stan/R command using partial proportional odds model
I have been trying to use the original Stan code (provided by Harrell and Goodrich) for an unconstrained partial proportional odds model to analyse some simulated data mimicking a two-arm trial (with ...
2
votes
1
answer
226
views
Why do the coefficents from orginal regularized regression (ordinalNet) have the wrong sign?
I have data with an ordered factor response ("low", "medium", "high") and a large number of predictor variables. I'm pursuing an ordinal regularized regression model ...
0
votes
0
answers
130
views
Effect size for two-way ordinal ANOVA with cumulative link model
I am looking for an effect size measure that is suitable for a two-way (2x2) ordinal ANOVA with cumulative link model.
I have seen the functions rank_eta_squared() and rank_epsilon_squared() but in my ...
1
vote
0
answers
143
views
Replacing One-Hot Encoding with Ordinal Encoding
As an example, I have a dataset of available games.
Game A graphics presets are: Low, Medium, High, Ultra
Game B graphics presets are: Minimum, Balanced, Maximum
Game C graphics presets are: Ultra
...
1
vote
1
answer
609
views
More robust and faster polr for ordinal regression
Looking for a workaround, if there is a more robust and faster polr to fit for High Multi-dimensional data in an ordinal data context. (Similiar to those like lm() and .lm.fit())
Example datasets: ...
0
votes
1
answer
341
views
Cannot fit multilevel ordinal logit model using clmm
I'm trying to fit a multilevel (random effects) ordered logit model using the ordinal package, but I keep running into this error:
Error in region:country1 : NA/NaN argument
Here's my simplified ...
4
votes
3
answers
903
views
Convert ordinal to numbers
Is there a built-in way to convert ordinal numbers to numeric vectors?
ordinal <- c("First", "Third", "Second")
ordinal_to_numeric(ordinal)
#[1] 1 3 2
ordinal2 <- ...
1
vote
2
answers
974
views
How to plot the predicted probabilities for an ordered logit regression?
I want to plot a similar plot as this one in the buttom of the page: ordered logit
They use a variabel on the x-axis that is categorical (0-10) and therefore they use seq(0, 10, 1) and hold all other ...
1
vote
0
answers
66
views
Getting error "invalid type (list) for variable" when running multiple models in a for loop: how to specify outcome/predictors?
For a study I am working on I need to create bootstrapped datasets and inverse probability weights for each dataset and then run a series of models for each of these datasets/weights. I am attempting ...
1
vote
2
answers
226
views
Multinomial regression : how to show all coefficients without L, Q and R?
I have this dataframe that I applied multinom function
df = data.frame(x = c('a','a','b','b','c','c','d','d','d','e','e','f','f',
'f','f','g','g','g','h','h','h','h','i','i','j','...
0
votes
1
answer
266
views
How to change all variables of a big dataset into ordinal factors that have different sets of orders for the levels of each one of them?
I have this dataframe with it structure (let's imagine it very big)
df = data.frame(x = 1:5,
y = 2:6,
z = letters[6:10],
m =10:14,
n ...
2
votes
2
answers
232
views
Standardized library / datatype for general ordinals in Haskell
I am looking to implement a "general" ordinal type that supports multiple "infinities" (e.g. [1,2,..., W, W+1, W+2, .. , 2 W, .., WW, etc]). I was thinking of implementing as a ...
0
votes
1
answer
42
views
Separating pandas dataframe column data into new new columns
my data column combines information on two axes: wealth and life stage.
I need to break up the two-digit codes by their 'tens'-place and 'ones'-place digits into two new ordinal variables. How would I ...
1
vote
0
answers
247
views
Failure to converge for ordinal logistic regression or Model nearly unidentifiable with large eigenvalue
Depending on which optimizer I use for this ordinal logistic regression I receive one of two errors.
This one:
logit <- clm(y ~ ., data = train, link = 'logit', method = 'optim')
Warning message:
(-...
0
votes
1
answer
498
views
How can I plot the difference between marginal effects for a categorical variable?
I'm trying to plot the difference between marginal effects for a dependent categorical variable. I have tried using emmeans, but I can't get what I want.
I'll try to follow the example in this ...
0
votes
2
answers
360
views
Does sklearn algorithm assume ordinal integer values as continuous features or categorical features?
Assume that in a machine learning problem, there are several categorical features in dataset.
One common way to handle categorical features is one-hot encoding. However, in this example, authors ...
0
votes
1
answer
282
views
Why am I getting NaNs in R while using ordinal regression (MASS::polr) and fitting an interaction?
I am using the polr function for ordinal regression. Without an interaction included results come out fine but as soon as I add the interaction I get 'In sqrt(diag(vc)): NaNs produced. The input and ...
2
votes
1
answer
1k
views
Viewing coefficients for each level in an ordinal CLMM model
Overview
I want to access the intercepts and coefficients for each level in a multilevel ordinal response model using the ordinal::clmm function in R.
I can easily do this with multilevel linear ...
0
votes
0
answers
96
views
Highcharts Ordinal Issue
I am struggling to understand why I cannot get the ordinal aspect of my spline type chart to work correctly! I created a series of bar charts a long time ago but having not done anything like this in ...
1
vote
1
answer
2k
views
How to plot an interaction effect within an ordinal regression model?
I have an ordinal model for predicting anxiety severity, using the clm() function. Within the model there is significant interaction effect between two of the variables. I am looking for a way to ...
0
votes
1
answer
490
views
Warning: "Intersecting linear/additive predictors" when fitting non-proportional odds ordinal regression model with VGLM()
I am fitting a partial proportional odds cumulative logit ordinal regression model. Response is an ordinal diagnosis, predictors are two urinary biomarkers. I fit the model using the following command:...
2
votes
2
answers
2k
views
How to get p values for odds ratios from an ordinal regression in r
I am trying to get the p values for my odds ratio from an ordinal regression using r.
I previously constructed my p values on the log odds like this
scm <- polr(finaloutcome ~ Size_no + Hegemony + ...
0
votes
2
answers
476
views
creating dummy variable from ordinal data in r
I have an ordinal variable with the following categories
very favorable (1)
somewhat favorable (2)
somewhat unfavorable (3)
very unfavorable (4)
don't know (8)
refuse to answer (9)
I want my output ...
0
votes
2
answers
755
views
Ordinal Encoder with Specific order include NAN
Let say that I have this example dataset
test = {'Education': ['High School', 'Uneducated', 'Graduate', 'College', np.nan, 'High School'],
'Gender': ['M', 'F', 'M', 'F', 'M', 'F']}
and the ...
1
vote
1
answer
1k
views
Calculate marginal effects for ordinal::clmm
I have some problems with calculating the AME (…average marginal effects…) from an ordinal model (ordinal::clmm()) with random effects (in my case a four level year factor). The functions margins::...
0
votes
0
answers
34
views
Check if any combination of binary variables is correlated/has impact on an ordinal dependent variable
I am working on a case to finish my (not so advanced) data scientist course and I have already been helped a lot by topics here, thanks!
Unfortunately now I am stuck again and cannot find an existing ...
1
vote
1
answer
354
views
Encoding categorical variables such that both the presence as well as the position of characters matter in literal strings
Let's assume we have a dataframe whose last column is made up of literal strings such as the following:
df = pd.DataFrame(
{
"col1": ["C", "A", "...
1
vote
0
answers
87
views
best way of using float as the conditional input for cGAN? one-hot encoder?
I'm trying to make a model for outputing an image based on speed (a float input). This can for example range from 1.0 to 6.0. so basically it is an cGAN, with a latent noise and a float as combined ...
0
votes
1
answer
2k
views
OrdinalEncoder' object has no attribute '_missing_indices'
I was able to train the model and deployed the endpoint successfully in Azure.
However, when I was testing the endpoint: it gives me the error below:
Failed to test real-time endpoint
{"...
1
vote
1
answer
184
views
Problem with categorization in pandas/OrdinalEncoder
I'm having some problems categorizing a column using pandas and OrdinalEncoder.
What I have to do is basically, convert a column to be categorical (so that I can use OrdinalEncoder after) but ...
1
vote
2
answers
1k
views
How to extract AIC from polr summary output in R
I'd like to quickly compare AICs that are provided as output when running summary() on individual polr() models created using the MASS package in R. I have no problem compiling this info, but what I ...