# 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.

3,575 questions
Filter by
Sorted by
Tagged with
29 views

### Multiple linear regression on just categorical variables? change ~ C(location)

I am trying to show that a categorical variable doesn't really affect a continuous variable. I am using statsmodel formula: sm.ols(formula=change ~ C(location)) ...
• 13
23 views

### Binomial logistic regression and inter-group comparison

I am interested in exploring the relationship between two categorical variables: "Ethnicity" and "Disease", each with two levels. My primary hypothesis is that individuals with &...
33 views

### Am I using the appropriate statistical comparison tests & applying them correctly to my qualitative coded data?

I am trying to determine if I am using the correct statistical tests in making comparisons & finding out if there are any statistically significant shifts of student attitudes. I have three open ...
36 views

### Simple Regression Coefficient Formula for Categorical Variable?

For an indepdent numerical variable X the B1 coefficient is COV(X,Y)/Var(X). Since Categorical Variables don't have things like Means(from which things like COV and VAR are derived) how would it work ...
• 125
1 vote
20 views

### Understanding different ways of coding categorical predictors in regression

Using this code and sample data: ...
• 11
48 views

### Regression in sex differences multiple dependent variables

If I want to examine sex differences in three variables, lets say academic attainment, study motivation, and a variable that is categorical. How should can I fit these variables with OLS regression? ...
38 views

### Warning when using sparse categorical values with LightGBM

When training a LightGBM model with lgbm.train, I get the following warning: [LightGBM] [Warning] Met categorical feature which contains sparse values. Consider ...
• 131
1 vote
38 views

### How does type II vs type III ANOVA work when there are more than two categorical predictors?

For a model with two categorical factors in the form: X = A + B Type I (used if the factors are balanced) calculates SS for each term in the model sequentially as follows: SS(A) then SS(B|A) = SS(A ...
11 views

### What is the standard performance metric for categorical data clustering?

I performed a categorical clustering with some selected UCI datasets. I one-hot encoded the features, then directly used Binomial Mixture Model and KModes using this one-hot encoded data. On the ...
46 views

### Best Practices for Difference-in-Difference Analysis of Quasi-Experimental Repeated Cross-Sectional (Cat.) Data Different Samples per Neighborhood

I'm working with repeated cross-sectional data where each measure comes from a different sample of respondents per neighborhood. My study aims to evaluate the impact of varying police patrol levels (...
• 141
20 views

### Panel Data Event Study

I am looking to analyse the impact (causal effect) of a conflict on firm valuation (using daily stock prices) for a sample of around 800 firms (I currently have this data over a sample period of ...
27 views

### Event study using Panel data or Fixed effects

I am looking to analyse the impact (causal effect) of a conflict on firm valuation (using daily prices) for a sample of around 800 firms (I currently have this data over a sample period of around 365 ...
17 views

### Interpreting R glm gamma output with interacting categorical predictors

I have a set of different gamma regressions that I ranked with AIC (with help from kind folks on CV) that show the effects of year (2019 and 2021) on "value" (an area), but I am struggling ...
221 views

### Calculating odds ratios for an interaction term

Ratgrp stands for lung function (FEV1/FVC)*100 and it has two categories: 1: Lung function less than 70 2: Lung function equal and higher than 70 ...
• 41
14 views

### What's the optimal observation count per category for Machine Learning?

I'm seeking some advice or references concerning the optimal number of observations required for each category within a categorical variable, specifically for machine learning projects. To give an ...
1 vote
24 views

### Test score equivalence - preparing data for Spearman correlation? [closed]

I have a somewhat theoretical question. I am trying to establish how closely scores across different language tests (IELTS, TOEFL, C1A, OET, DET) used in public domains match each other, given that ...
• 11
87 views

### One class never gets predicted, regardless of the model

I'm working on a classification problem from a dataset containing three classes, with proportions {"0":0.43, "1":0.25, "2":0.30}. ...
86 views

### Is a binomial logistic regression valid in this case, and how do I use it / interpret its results?

I am facing the unusual problem that my $p$ values are too good. They are so good that I must be doing something wrong, but I don't know what. I am working with natural language data from a text ...
• 143
25 views

### Is it possible to run a zero-inflated negative binomial model with complete separation? [duplicate]

I am trying to analyze how the number of events Y is influenced by three factors A (4 levels), B (2 levels) and C (2 levels) and the interactions between the three. Initially trying a poisson ...
25 views

### Assessing Impact of Categorical Features in Classification with Multiple Models

I am working on a binary classification problem with a limited dataset (50 observations), aiming to understand the influence of categorical features on the target variable. I'm exploring several ...
25 views

### Opinion about conversion of factor to numeric variable during model development using caret package

caret package automatically converts factor variables to one-hot encoding. We can also convert the factor variable to a numeric variable before training any model. ...
• 107
153 views

### Setting priors for categorical variables in bayesian multilevel model analysis with BRMS package (repost)

I am reposting the same question that I made on Stack Overflow. I am new with Bayesian analysis methods and I am still struggling understanding some concepts regarding priors. I am running a model ...
• 41
21 views

### Correspondence analysis

I have a question. I have the following categorical data from an open text diary study: Individuals reported emotions in different situations. Each individual reported their emotions in 3 to 5 ...
187 views

### Linear Regression with Only Categorical Features: Evaluating the Model

Big Idea: This might seem a bit rambly, but there is a unified theme: how good is my model, and can I trust the predictions it's giving me? Background: I am performing a linear regression (not ...
• 5,862
20 views

### What reference to use when you have categorical data and there is no "control" category in Mixed effects model

I have gathered data from 100 participants and want had the data labelled using two different methods. Meaning that I have 2 datasets for each participant, one labelled by method 1 and one by method 2....
273 views

### Missing Coefficients in Linear Regression with Multiple Categorical Variables in R

I have an odd scenario where I am trying to regress a numerical variable on several categorical variables, with no other numerical variables. I have roughly 23k rows of data in my real-world example. ...
• 5,862
30 views

### Rank deficiency and interaction term not estimated

I am trying to inspect the data from a 2 x 2 factorial design. The experiment was run by other researchers and the design was settled upon before. Participants were tested 3 times using 3 different ...
47 views

### Can I violate assumptions of normality for categorical linear regression models?

I'm using packages included in this R/rStudio tutorial to set up some linear regression models comparing a continuous dependent variable (eccentricity) to three categorical variables (year, bird ...
33 views

### Partial Correlation and 1 Categorical Control Variable with 3 Categories

I'm trying to calculate the partial correlation between continuous variables $X$ and $Y$ while controlling for $Z$ (a categorical variable with three possible categories). Tutorials and answered ...
• 21
1 vote
43 views

### Impulse Response of a dummy Variable

I am writing a paper about electoral periods and its effect in the exchange rate. I estimated a VAR model where the electoral period dummy its included in the var. I am trying to measure the impulse ...
23 views

### Checking expected counts when analyzing binary outcome and binary explanatory variable using GLM

Understand that chi-squared test comparing two categorical variables is only valid when expected counts for each cell is at least 5. I have not read or heard that this needs to be checked when running ...
• 855
22 views

### Need help with chi-square test interpretation with adjusted residuals

I have conducted multiple chi-square tests to compare 3 customer segments (1 cat variable, 3 groups) on different categorical variables. As the chi-square tests are not 2×2, I have asked SPSS to ...
• 7
117 views

### Everyday life example of spurious cause and effect relation

I'm stuck on the following issue. I want to find simple examples from everyday life where it's clear that a categorical and a quantitative variable are not connected by a cause-and-effect relationship....
49 views

### Modification of Pearson's Chi-square test

At first glance, Pearson's chi-squared test seems flawed in a major way. Can you help me identify the error in my logic? I have a multinomial distribution with $k$ outcomes, and $p_i$ denotes the ...
• 163
36 views

### How appropriate is this logistic regression analysis?

I am reviewing this study where they measured fathers' stress, anxiety and depression levels at four-time points. And they measured the child's behavioural problems only at the last time. They then ...
• 43
180 views

### Best plot in R for count data with a broad range and lots of low frequency data

I have a data set that looks like this, in reality there are about twenty categories with a count of 1: ...
• 195
78 views

### How to test non-mutually exclusive categorical data (with groups)?

I have a dataset which looks as follows: Patient ID Group Disease 1 Disease 2 Disease 3 01 A 0 1 0 02 B 1 1 0 03 B 1 1 0 04 A 1 1 0 ... ... ... ... ... As you can see, I have two groups A and B,...
• 183
1 vote
34 views

### How to produce a p-value for each category in a chi-square test [closed]

Cross tables are used to produce differences between two groups in the chi-square test. For example, if we look at the differences in age groups between the two groups (such as the group A and the ...
• 11
1 vote
53 views

### Using Cramer's V to find which variable has the strongest correlation

Apologies in advance if this has been asked before; I'm a stats amateur and wasn't having much luck with my searches. I'm currently analyzing product data, and I'm trying to find which variables (all ...
• 11
39 views

### Terminology: multivariable when multiple levels of categorical variable?

Oftentimes, one sees people use terms such as univariate and multivariate logistic regression, where they clearly refer to number of predictors rather than number of response variables. I know it ...
91 views

### Hypothesis testing of categorical variable

I have extracted data from a questionnaire about factors influencing employability of young graduates. The questionnaire was answered by students in my class, so I extracted their age, major, and ...
• 123
18 views

### Hierarchical cluster analysis with mixed data

I have a dataset consisting of 134 observations and four variables. The dataset consists of answers to a questionnaire. I want to perform a hierarchical cluster analysis on the variables in the ...
30 views

### Is there a mixed effects regression model with categorical but non-binomial response variable? (i.e. more than 2 outcomes?)

I have a set of data which does not fit the typical parameters for parametric tests of association, and I need to account for the one of the variables as a random effect. After research, I found that ...
• 33
1 vote
48 views

### How to find relationship between a categorical nominal variable and numerical variable? [closed]

I am interested in finding the relationship between a nominal categorical variable and a numerical variable. We can't use scatter diagrams, or measurements of correlations for finding such ...
• 111
44 views

### How to find relationship between two nominal categorical variables? [closed]

I have a problem which requires to find relationship between two nominal categorical variables. What can be used to find such relatioship?
• 111
1 vote
59 views

### Is my interpretation of interaction of factors in a mixed model correct?

I have a linear mixed model in R for predicting the numeric value invested by participants in a Trust Game (it's an experimental paradigm) with the factors "group" (intervention group and ...
38 views

### Incorporating group charasteristics in multi-output regression setting

I'm working on a multi-output regression problem involving the prediction of over 80 numerical targets using an equivalent number of numerical features. I have achieved encouraging results with ...
1 vote
41 views

### Chi square by association on categorical variables

I am conducting a review of methods used over years in different locations and forests. I have a data set that looks like this (this is only a portion, I have 395 rows): ...
1 vote
I want to investigate the association between the serum glucose level of a patient with type 2 diabetes at the baseline (continuous) and distal neuropathy (categorical), $5$ years after the diagnosis. ...