Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
4 views

Maximum Possible Variation Ratio

When calculating the maximum possible variation ratio for a variable, what does k represent? Bachman and Paternoster (2017, p. 107) define the variation ratio as: ...
0
votes
1answer
25 views

With lme4, is it possible to weight group-level random effects by similarity?

I'm creating a model with two group-level random effects: district (factor) and age (factor) and a response, ...
0
votes
0answers
16 views

How to compute (and report correctly) the signifiance of interaction effect on categorical data, using logistic regression

I want to study the odds of success and failure at some test, depending on gender and some other categorical variables. I calculated the Odds Ratios (OR) of success using Logistic Regression, with « ...
1
vote
0answers
48 views

R - Linear Regression with parameters constraint - contr.sum contrast

I am facing a problem with running a simple OLS regression with two categorical independent variable. I would like to impose that the sum of the coefficients referred to one variable (x in the ...
0
votes
0answers
9 views

Clarification on quantification of Categorical variables

I have a countries column with 49 levels. I want to quantify it. If I run CATPCA on that column would i be able to get the quantified result. Since CatPCA is like PCA or factor analysis: it extracts ...
1
vote
1answer
21 views

Predicting items based on time and weather

I've got a data-set with items bought, the time it was bought (I can add the weather of the location at that time of the day). I would like a simple "prediction" model based on time and weather. ...
3
votes
2answers
250 views

Fisher exact test on 4 x 3 table, with low count?

I'm thinking about applying Fisher Exact Test for the following contingency table: ...
1
vote
1answer
56 views

multiple logistic regressions with binary predictors vs single logistic regression with categorical predictors

I would like to know which is statistically more advisable and what are the advantages and disadvantages of each approach. My data frame data has ...
0
votes
0answers
17 views

Visual representation of strong associations of two categorical variables

I have a dataset of one categoric variable "supermarket" for each individual person and multiple "product" categories per person and supermarket. E.g.: Person 1 went shopping in supermarket X and ...
0
votes
1answer
49 views

Using chi square on unequal groups with unequal repeated trials

My dataset includes four groups (A, B, C, D) of unequal numbers of individuals. Each individual engages in an activity that results in one of three categorical outcomes (X, Y, Z). The individuals ...
0
votes
0answers
22 views

Experimental design: two distinct, extreme group vs gradient design

I am designing an experiment in which I am exposing animals (the salt marsh-inhabiting amphipod Orchestia gammarellus) to environmental drought and salinity stress. I want to induce an evolutionary ...
0
votes
0answers
12 views

What is the best way to cluster categorical data to form homogenous groups?

I have a dataset with categorical data, some are binary some are options that have been numerically coded but are not ordinal. Most of this data is categorical "Yes/No" or Nominal for example Favorite ...
2
votes
1answer
19 views

How to test if the probability of one category is larger than another in the same sample?

I have a multiple choice problem with 4 options, A, B, C, and D. I know the number of people choosing each of the four options. How should I test the null hypothesis that the probability of choosing A ...
3
votes
1answer
68 views

When is deviation coding useful?

After many years of learning about contrasts in linear models I am curious about the relative usefulness of deviation coding, as it is defined by this website. I would appreciate someone filling me in ...
2
votes
1answer
26 views

The significance of two categorical variables on students' scores

I am analysing a set of students' scores on a Maths test. My data set includes 41 students. I have the students' marks on each question of the test. I have the gender of each student. I also have ...
0
votes
1answer
17 views
3
votes
1answer
64 views

why has author divided by 1.5 in hands on machine learning with scikit learn

I am reading Hands-On Machine Learning with Scikit-Learn and TensorFlow (76/718), and the author is talking about dividing the dataset into a test set which i follow, but then goes on to talk about ...
0
votes
1answer
30 views

How to calculate value of a variable based on three other variables(all are correlated with wanted variable)?

soo i have a ratio variable(salary) and three other variables(country by hdi index, soo interval variable, and college degree type, soo nominal variable and personality(extraversion, introversion), ...
2
votes
0answers
28 views

Frequency analysis of categorical/binary data

I want to do frequency analysis with a data set of consecutive binary values, such as "Rainy - Sunny - Rainy - Rainy - Rainy - Sunny - ...". Using this data, I want to extract the frequency (= the ...
3
votes
2answers
59 views

Should I treat age as a continuous variable or factor?

Age is a predictor variable among a few others (gender, weight and height) and my response is the log-odds of a certain disease (binomial glm). My age data runs from 21 until 40. I am not sure ...
-1
votes
0answers
16 views

Understanding MLE for a Gaussian Naive Bayes classifier

I am trying to develop a text classifier and I'm reading about MLE to help me understand the process. I came across this example: and I wanted to try this myself. I'm running into a problem and so ...
1
vote
1answer
30 views

Multiple linear regression: observations with 2 or more values per factor / categories - a problem?

Is it a problem for linear regression (lm in R) to have observations that have multiple values for a given factor? For example, I have the weekly average sales <...
0
votes
0answers
8 views

Create a composite score from nominal, ordinal and scale data [duplicate]

I want to calculate a composite score for temper tantrums' severity. I want the variable to be dichotomous so that it represents normal temper tantrums and severe temper tantrums. Severe tantrums ...
1
vote
0answers
17 views

How to compare frequencies of categorical variable with 3 possible values

There is one variable which can get one of 3 values and one sample. Lets assume values are A, B, C and frequencies are x, y, and z. How could I find if x > max(y,z), statistically significant? Or, in ...
10
votes
5answers
3k views

Why should binning be avoided at all costs?

So I've read a few posts about why binning should always be avoided. A popular reference for that claim being this link. The main getaway being that the binning points (or cutpoints) are rather ...
2
votes
1answer
24 views

accounting for age effects: two age groups and within-group age differences

I am analyzing data from a study with two groups of about 25 healthy participants each, one young (mean age ~25 [~18-~30] years) and one older (mean age 59 [45-75] years). The study was set up mainly ...
1
vote
0answers
22 views

Transforming a categorical distribution up side down

I have the following categorical distribution: $$ original = (2, 7, 3, 5, 0, 1, 4, 6, 3, 8, 8)\\ \sum original = 47 $$ I want to transform it to its upside down distribution step by step, while ...
0
votes
1answer
16 views

How to interpret the output when one or two levels are significant in the seemingly insignificant categorical predictor in logistic regression

I am running a multilevel binary logistic in SPSS. The predictor variable in question is a categorical variable with four levels. In the first fixed effect table, it seems like the predictor variable ...
1
vote
1answer
11 views

How to interpret categorical variables with many categories logistics regression (SPSS)

I am having trouble finding any resources to help me interpret my logistic regression results. I'm using SPSS, but I don't think that matters a whole lot. I understand the odds ratio concept (as well ...
1
vote
1answer
38 views

Which Statistic Test should I apply in the following scenarios

I have a survey data with Yes/No response variable and a categorical variable assigning survey takers to one of the 4 groups: 16-24 years old 25-34 years old 35-54 years old 55+ years old I want to ...
0
votes
1answer
40 views

How can I regress if all the variables are categorical?

I am working with a dataset of 335 categorical variables. The dependent variable is also categorical variable, as following: How satisfied are you with your life: 1.unhappy ... to 10. very happy. I ...
0
votes
1answer
37 views

Interpreting categorical interaction terms

I am wondering how to interpret results of interaction terms (see image below). I think to know that the interaction term 1 (IV x potential moderator group 1) depicts the difference of association ...
1
vote
0answers
15 views

Best test for 2xK contingency table with low cell counts and small overall sample size?

I am looking for the optimal test to use on a contingency table with 2 categorical variables (first variable has 2 levels, second has 4 variables). The cell counts can be as low as 1 or 2 and the ...
0
votes
0answers
11 views

factor analysis issue

Hey guys I tried a factor analysis in spss (CFA) with a goal to compute 1 overall variable on negativity out of 8 measuring variables. but when I ran my model i got two components, whether my goal was ...
0
votes
0answers
30 views

Coding a categorical variable: 0-1 or multiple subcategories?

I'm working with R and want to run a correspondance analysis on a dataset containing, among the others, the following factors: city district: 27 levels, each corresponding to a given district ...
0
votes
1answer
32 views

Constructing 3-way ANOVA when design is not fully factorial

I have conducted an experiment measuring individual sizes as a function of two categorical variables (A and B), each with three levels (1, 2, 3). The combination A3:B3 is a control group. This ...
0
votes
1answer
28 views

What test for a 4-level categorical variable and a continuous variable?

I'm currently doing research on whether image quality affects engagement. Image quality is given in 4 categories (bad, benchmark, semi-professional and commercial level) and engagement is in how many ...
1
vote
1answer
41 views

(Low cardinality) categorical features handling in gradient boosting libraries

In some popular gradient boosting libraries (lgb, catboost), they all seems like can handle categorical inputs by just specifying the column names of the categorical features, and pass it into a ...
0
votes
0answers
19 views

Bootstrapped linear regression with unbalanced factors

I am investigating the relationship between Valence ratings (continuous response variable) and Condition (4-level factor) as ...
0
votes
1answer
19 views

Analysing partially ordered responses

I'd like to analyse judges' decisions on bail. Ie some decisions (remand in prison) and clearly worse than others (unconditional bail). But in the middle there are a range of possible responses that ...
4
votes
1answer
46 views

Is there a statistical test for comparing count/frequency of different groups (just one dimension)?

This seems very simple question, but I could not get my head through it. The data is like below: In the sample of 30 patients, patients can have four types of treatment. we want to know whether B ...
0
votes
1answer
30 views

How to interpret a boxplot to check for assumptions?

This boxplot shows 5 different forms of dancing, on the y axis we have the number of injuries. This is an ANOVA model. The question is, what assumptions could not be met according to this boxplot? I ...
0
votes
0answers
27 views

Calculating odds ratio in Multiple select choice question analysis

I have a multiple response categorical variable (MRCV) and a single response categorical variable (SRCV). Respondents in my survey were presented with 6 choices (6 barriers to access an application) ...
1
vote
4answers
232 views

Regression with Lots of Categorical Variables

I'm facing a regression task with many categorical and few numeric features. I encoded them into dummies and removed the first dummy column for each feature. I am not getting very good R2 at all. I ...
0
votes
0answers
17 views

How to evaluate relationships with categorical variables?

I am working on the BigMart dataset. One of the variables has a substantial amount of missing values. I'd like to check whether these are missing completely at random. There are 12 variables, 4 are ...
1
vote
1answer
26 views

Analytical solution to the covariance between a continuous and a categorical variable

Let $X$ be a continuous variable with mean $\mu$ and $Y$ be a categorical variable with event probability vector $\mathbf{p}$. I am trying to calculate $\operatorname{Cov}(X, Y)$. I have the solution ...
0
votes
1answer
19 views

Multiple nominal categories predicting a continuous variable

This is a simplified version of the problem that I'm having, but I'm really looking for the appropriate type of analysis for the question in which I'm interested. Set up: I have a large data set in ...
1
vote
1answer
50 views

Why does GBM package make different predictions for the same data point (after factor issue is fixed)?

I tried to use a GBM model to make predictions for the same data point, but it gave me very different answers. Please see the example below. When using the entire dataset for predicting the first data ...
0
votes
0answers
9 views

How to handle different input sizes of an NN when One-Hot-Encoding a categorical input?

let's assume an input dataset that is a mix of categorical values and real values. When preprocessing this data into an appropriate NN input, OHE is recommended because it doesn't assume any order of ...
0
votes
1answer
29 views

How to handle and test categorical dummy variables when interested only in certain levels?

I want to build a multiple linear regression model. I want to test the effect of a nominal variable with 10+ levels, but I am interested in testing only the effect of 2 of them. 1st Question: How ...