# Questions tagged [categorical-data]

Categorical (also called nominal) data can take on a limited number of possible values called categories. Categorical values "label", they do not "measure". Please use [ordinal-data] tag for discrete but ordered data types.

2,876 questions
Filter by
Sorted by
Tagged with
40 views

### How to compare AIC and goodness of fit tests?

My data is categorical. I have fitted two models, say, model 1 and model 2. Model 1 is larger than model 2 (in terms of the number of estimated parameters) and model 2 is nested within model 1. AIC ...
37 views

### Location variables as factor or numeric?

I have a data set where my observations are geographically referenced by longitude & latitude, as well as by township & range. If you're unfamiliar with township & range: The land is ...
92 views

### difference between interval scale and ratio scale in classifying Data

I was reading about 'different types of data'. I understood the concept of nominal and order based data. But I did not have a clear picture about the difference between interval and ratio scaled data. ...
16 views

### Ordered probit / multinomial probit models, marginal effects difference

I'm working with National Longitudinal Survey of Youth (NLSY79 and NLSY97), which include two datasets, with the same variables, about students surveyed in 1979 and 1997. I created as output a ...
8 views

### Use predict function for average over all levels with contrast.sum

I have a model with Machine as factorial variable. The contrast is set to "contr.sum". ...
16 views

### Homoscedascity tests for Two-Way ANOVA (a factor and a covariate or two factors)

I have the following formula: glm1 <- glm(y ~ g1 + g2, data = fish, family = binomial) y is a binomial variable: num 1 1 0 0 1 0 0 0 0 1 ... #There is (1) or ...
60 views

### Partial correlation for dichotomous variable in Python

I would like to compute the partial correlation between a target categorical variable y (= A or B) and a number of numerical (discrete or continuous) predictors. In the following post: https://...
57 views

### How to simulate predicted probabilities

Can you help me out with the following brain twister? I have a prediction model to estimate the probability (p) of a sale for each potential customer. On average, p is 0.003. (So there is approx. one ...
9 views

### sample size determination for a system with several states

I would like to ask for help to determine the sample size of systems that could stay in any of the five states that are decreasing quality ( 5, 4, 3, 2, 1). 5 is the highest quality and 1 is the ...
22 views

### Relationship between two nominal variables with many categories

I have two nominal variables, one with 10 categories and one with 12 categories (n = ~800). I hypothesise that these variables aren't related, but have been searching for tests that would show a ...
76 views

### Implementing Scikit Learn's FeatureHasher for High Cardinality Categorical Data

Background: I am working on a binary classification of health insurance claims. The data I am working with has approximately 1 million rows and a mix of numeric features and categorical features (all ...
28 views

### How is VIF calculated for dummy variables?

I have a logistic regression model with 11 explanatory variables, 5 of which are dummy variables, when I use vif() function from library car in R, it gives me a VIF value for each of them. As far as I ...
23 views

### Compare the variances of multiple categorical distributions in a repeated measure design

I ran three model-building procedures with different parameters on the same sample and obtained the selection of my optimized hyperparameter for each outer fold (each of the analyses had 100 outer ...
248 views

### Feature Importance for Multinomial Logistic Regression

I have trained a logistic regression model with 4 possible output labels. I want to determine the overall feature importance for each feature irrespective of a specific output label. In case of binary ...
10 views

### Random forest favouring variable with most categories

During my experiment with Random forest I found that it was always biased towards the variable with highest categories and when I went through literature study, I found it was one of the drawbacks of ...
43 views

### Predicting outcomes with categorical predictors

My dataset is formulated in a contingency table. My predictor variables are categorical and my dependent variable is the number of observations observed. How do I predict outcomes and find residuals? ...
19 views

### About scaling of data in political science

Sometimes we will see a survey about social and political opinions and social opinions, the author is trying to combine the polling results, fit them into a curve and make some conclusions. Let's say ...
12 views

### Factors or dummy variables for a categorical binary response variable? Which approach is better for Machine Learning/Logistic regression in R?

I am new to R and I am creating a glm for a dataset trying to see the covariates that affect if someone is hyper or not hyper(my target categorical binary variable)[hyperness variable]. I am ...
23 views

### Multivariate regression: independent categorical variable with 5+ non-mutually exclusive levels

My data set consists of around 461 acquisitions of firms, each with different motivations, that is acquisition_reason. I want to predict a count variable using acquisition_reason as my main ...
10 views

### Interpretable Measure of Association between a dichotomous variable and a variable with more than two ordered categories

What measure of association including a positive or negative sign can be used to evaluate the association between a dichotomous variable (i.e. YES, NO) and a categorical ordinal variable (ie. A lot, ...
26 views

### Need Help With the right Statistical Test to use

I am doing a research on transpersonal studies. Here's a brief background: Transpersonal is considered to be a phenomenon where one's sense of self-identity is expanded beyond the ego. Transpersonal ...
26 views

### Help Selecting Statistical Test

I am looking for advice on how to analyze some experimental data. My DV is a binary response variable - yes or no (coded as 1 and 0). Usually when I run experiments I fully cross all conditions ...
12 views

### Logistic Regression and Normalize Mean Variance for categorical metrics

I use Power BI quite a bit for data analysis. When analyzing categorical metrics, one of the techniques it uses, under the hood, is something called Normalize Mean Variance when performing logistic ...
37 views

### Displaying differences between two sets of continuous(with error)-categorical values

I hope someone can help. I am looking to plot the temperature vs. density difference between two systems. The temperature is represented by four categorical variable values (292, 302, 312, 322). ...
35 views

### Self organized maps on mixed dataset (categoricals / numerics features )

i have a dataset of mixed variables and i want to apply self organized maps on it how can i extend som to mixed dataset? can i use the gower distance instead of euclidienne distance in order to ...
37 views

### I am drawing balls of three colours from an urn until it is empty. Is the sequence of colours random?

I have the following problem. I have an urn with n balls of k different colours. I draw balls without replacement until the urn is empty. This leads to a sequence of colours. I now want to show that ...
22 views

### How to Describe Interaction Between Variables

Say I have two demographic variables, job$\in{j_1, j_2}$ and lives$\_$alone$\in${YES, NO}. I also have N books $B_1$, $\ldots$, $B_N$, each labelled with a genre that I know in advance, out of {...
107 views

### Statistical test for repeated measure data (3x2 contingency table)

This is my dataset Newspaper Internet MN 45 115 IA 20 9 MO 114 56 What statistical test should ...
30 views

### R utility for pulling out parameters for individual variable in lm when there are effect modifiers (interactions with categorical variables)

NOTE: I think the emmeans package may be what I'm looking for. Still welcome any input! Suppose I have a regression model $y = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \beta_3 x_1 x_2$, where $x_1$ is ...
19 views

### Best way to predict categorical data using continuous data

In my data I am trying to predict the affect state using the emotions. I am trying to predict SelfReport State (factors are "FLOW", "FRUSTRATION", "BOREDOM", and "...
68 views

### EM algorithm for mixture of categorical distributions instantly stabilizes

Brief Summary of Question I'm trying to fit a mixture model of categorical distributions (see https://en.wikipedia.org/wiki/Categorical_distribution). The expectation at the second time step is ...
54 views

### What statistical test to use for categorical data with 3 or more groups

We conducted A/B/C test in our website and now i want to check the results. But the problem i faced is that there are 2 test groups and 1 control, and not 1 test and 1 control groups as usual. When ...
15 views

### Descriptive and inferential analysis on survey data

I have a dataframe containing the answers to a survey regarding medical training. Each record has personal data, like age, sex, location, etc., as well as the answers to 60 questions, each answered ...
15 views

### Aggregating categories in categorical variables when insignificant in regression

I would like to run a regression model with all categorical variables. Since my response is count data, I am using a negative binomial regression model. I would like to retain as many categories as ...
4 views

### Figuring confidence intervals for classification using the variance of categorical random variables

Pronk et al show how to calculate confidence intervals for Bayesian classifications. A key part of their model is the variance of the ratio of two binomially distributed random variables (13). They ...
19 views

### PCA can be used for categorical variables, when to only thing that you wanna explore is the explained variance and no the ordination of data?

I Need to know how effective are a set of categorical variables in explaining the pattern of species distribution, in order to model a potential distribution. I already explore with numerical ...
13 views

### What statistical test can be used to test if multiple samples of data originate from the same underlying distributions?

I have a data-set with several independent variables, and my depended variable can get only positive values (it looks somewhat like a gamma-distribution). For example - let's say the data is similar ...
37 views

### How to deal with unbalanced time series data for machine learning?

My understanding when it comes to unbalanced datasets is that we can randomly sample from the dominant class. What are some ways to deal with unbalanced data when we have time series data and the ...
27 views

### Different ANOVAs by subgroup

I am analysing data which I generated using a simulation model. Due to the stochasticity of the model, the output is also stochastic. I have several dependent variables (let's say X and Y) and vary ...
8 views

### How to measure difference in 2 clusters/groups with a table with both categorical and numeric features

I'm very new to data wrangling. And now I have this problem at hand: So basically I have used tables of biochemical measurements (all numerical) of patients to perform cluster analysis, and by doing ...
18 views

### Prior for categorical transformation in catboost

I applied CatBoost to a binary classification problem with a feature with lots of unique values. I was surprised when SHAP analysis showed that new, unseen values in the validation set had a very ...
258 views

### Losing Observations in Logistic Regression in Stata

I have a data frame in Stata with 316 observations and I am trying to run some regression models on the data: none of the variables I am including in my model have missing data for these 316 ...
20 views

### Determining probability from categorical variable data

Whist reviewing some test data I am looking for advice on identifying the correct statistical tool(s) to help me answer two questions. The data I am looking at is from a cytotoxicity test, whereby a ...
21 views

### Approaching in choosing algorithms or tuning algorithms for multiclassification problem

To describe the dataset, the dataset comprise of about 13 independent features , out of which 8 are numerical features and the other 3 features are highly cardinal categorical. The other 2 variables ...
33 views

### Compact encoding (vectorization) of unbounded sets

Question I have a set of sets. Each set is unbounded. I would like to find a methodology to encode (vectorize) each subset. I am more specifically interested in memory efficient solutions. ...
5 views

### Unordered Categorical Data - Mixed Values

I am currently building a machine learning classifier to deal with both numerical and categorical data. Within the categorical data, I am coming across a slightly niche case. Assuming one of my input ...
24 views

### Compare Event frequency in two different data set

Assume we have two groups of categorical data: Group A: 10000 categorical events, such as Event1, Event2, Event3, ..., Event10 Group B: 100 categorical events, same events of group A, but recorded at ...
18 views

### Problems with overrepresentation in the data?

(I hope I am in the correct place here to ask this, if not I apologize beforehand) I understand that it should be a problem if one group is way more present in the data but after a discussion with ...
In LDA (Linear Discriminant Analysis), we are trying to compute $$P(Y=k | X = x) = \frac{ P(X = x | Y=k) * P(Y=k)}{P(X=x)},$$ where $k = 1,2,...,n$ stands for category labels. Now, P(Y = k) can be ...