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.

980 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8
votes
1answer
789 views

How do I test for independence with non-exclusive categorical variables?

Introduction I have a categorical contingency table with many rows and a binary outcome, which I count: ...
8
votes
1answer
1k views

How to handle multiple measurements per participant, with categorical data?

I've done an experiment where I've collected measurements from a number of participants. Each relevant data point has two variables, both categorical: in fact, each variable has two possible values (...
8
votes
0answers
610 views

Recommended method for finding archetypes or clusters

I wish to cluster users together in a database, with each user represented by a number of features that are both discrete and continuous in nature. The aim is to define a small number of archetypal "...
7
votes
0answers
5k views

Panel regressions with an interaction term between a time dummy variable and a time invariant variable

I have estimated the coefficients of the following equation, using the fixed-effect model: $Y_{it}=\alpha _i+ \rho _t + \beta _1 X_{it}+\beta _2 C_i*D_t+\epsilon_{it}$ I have observations from 1980 ...
5
votes
0answers
485 views

Regression on large samples: can aggregation of the dependent variable by covariate pattern increase speed of estimation?

Is there a way to build a regression model for continuous output using aggregate data instead of individual data points when all input variables are categorical? I have a moderately large dataset (...
5
votes
0answers
696 views

Show Pearson Chi-Square Statistic is Score Statistic for Multinomial Data

I've read in many textbooks that the Pearson Chi-Square statistic is a score statistic in the multinomial setting (as well as others). I thought it would be a good exercise to derive this, but I am ...
5
votes
0answers
425 views

Are there useful distributions for ternary variables (e.g. $-1,0,1$ data)?

The title says it. If one wishes to analyze ternary outcomes—that is categorical outcomes with specifically three values (-1,0,1)—are $\chi^{2}$ / contingency table tests and multinomial-logistic ...
5
votes
1answer
4k views

Polychoric PCA and component loadings in Stata

I’m using Stata 12.0, and I’ve downloaded the polychoricpca command written by Stas Kolenikov, which I wanted to use with data that includes a mix of categorical ...
5
votes
0answers
73 views

Analysing when tunes are alike: testing ordinal and categorical similarity

I'd like to compare some Jazz tunes. Jazz tunes are characterized by a succession of chords. The interval between each succeeding chord (number of tones) and the order in which they appear matter. ...
5
votes
0answers
121 views

Graphical nominal model

Suppose I have a set of $k$ matrices. $$ \mathbb D = A_1,A_2,...,A_k $$ Each column of $A$ is categorical vector. $$ A = v_1,v_2,...,v_n $$ I want to find the mapping $$ f: A \...
4
votes
0answers
714 views

One hot encoding on a categorical variable with many values following a power-law distribution for use in logistic regression

I have a categorical variable (e.g., office locations) with about 500 values. The frequency of the values follow a power-law distribution (if you sort the categorical values by frequency descendingly),...
4
votes
0answers
62 views

Bayesian prior over long probability vectors

Suppose you have i.i.d. variables $x_i$ in ${1,\ldots,K}$ modeled as $$P(x_i = k) = \theta_k$$ and and you want to infer the probability vector $\theta$. A Bayesian approach puts a prior over $\...
4
votes
0answers
83 views

Categorical Variables With Little Variation. Chi-Square Test Power

Suppose you are trying to determine whether there is an association between gender and a rare disease, I suppose using the Chi-Square test. My intuition tells me that you must observe so many men, ...
4
votes
0answers
754 views

Coefficients of dummy variables in multiple regression

I am struggling with interpreting coefficients from a multiple regression analysis with multiple categorical (dummy) variables. I am running a linear mixed model with biodiversity (...
4
votes
0answers
116 views

How to use information about likelihood of classes in a classifier?

General question: How can information about the likelihood of classes be used to improve a classifier? Suppose that the probability of each class is known quite precisely (from a very large sample), ...
4
votes
0answers
235 views

Distance between independent observations of a categorical variable

I have a random variable $T$ that takes values in $\{ \text{blue}, \text{green}, \text{red} \}$, and a number of observations of $T$: ...
4
votes
0answers
1k views

How does GBM model handle categorical variables with many levels

I am using gbm model to fit a continuous dependent variable Y with several categorical variables, say, X, Z, V, and W. Suppose X has many levels (distinct values) and Y has moderate number of levels, ...
4
votes
0answers
637 views

Stratified Cross-Validation with Collaborative Filtering

My dataset consists of binary preferences ($0$ or $1$) given by users on items like this: User-ID | Item-ID | Preference If a user has not given a preference to an item, then it is not in the ...
4
votes
0answers
318 views

Equivalence of log linear and logistic regression for categorical variables

This question is similar to Does every log-linear model have a perfectly equivalent logistic regression? but my problem is understanding the proof.Every proof is very similar to the one found on: ...
4
votes
0answers
2k views

Binomial logistic regression in SPSS using survey weights

I am running a logistic regression in SPSS with a sample that uses survey weights. The sample size is 1000 and the weights are along the lines of .86 or 1.23 depending on the case. I am using the ...
4
votes
0answers
123 views

Splitting a variable with nominal and numeric values

I have a variable that has both numeric and nominal components. The source has a documentation which helps in identifying which is which and for splitting into their proper components. I will do ...
4
votes
0answers
469 views

Cluster on high dimensional categorical data (Images with keywords)

We're looking for clues to perform a Cluster Analysis in a DB with +400K images which have keywords associated to them. Each image could have from 1 to 30 keywords. Total keywords count is +35K. ...
4
votes
0answers
6k views

Test for effects of two categorical variables on a binary response variable?

I am looking for a test similar to a 2-way ANOVA that would work on a binary response variable. My response variable is survival of plant seedlings (alive or dead). My explanatory variables are ...
4
votes
0answers
1k views

How to compare two power law distributions?

Disclaimer: I am a biologist, so please don't hesitate to correct me if I am making unwise assumptions. I am looking at the distribution of a unique 6mer in a series of 2100mer (I have 415 ...
4
votes
1answer
4k views

How to compute the correlation coefficient between continuous and discrete variables ?

Is there any adjustment required when computing the correlation coefficient between: continuous and discrete variable two discrete variables ? Thanks !
3
votes
0answers
27 views

A goodness of fit test for two discrete distributions with unequal variance?

I have a computer simulation in which a virtual agent end up in different areas of a layout based on several factors. There are 18 conditions, so the data (you can find the csv file for a toy dataset ...
3
votes
1answer
74 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 ...
3
votes
0answers
35 views

“Does not apply” category frequencies are much higher than the frequencies of any other category in the variable

I'm working with the data from a national survey. In some of the variables frequencies for "does not apply" category are much higher than for any other response in the variable. Do I just ignore the ...
3
votes
0answers
3k views

Mixed Model with categorical response variable

In a study on a bird species, I observe 558 locations. Each location is assigned one of 4 cases: never occupied by the species (never) occupied in the past but abandoned now (past) occupied in the ...
3
votes
0answers
96 views

How should I specify my random effect when it is correlated to a fixed effect?

I want to perform a GLMM on my data in R using lme4. I have one response variable measured on more than 250 individuals. For each of those individuals, a ...
3
votes
0answers
357 views

Ordered logistic Regression with categorical variables

I am conducting a regression. There is an ordinal dependent variable (ordered from 1 to three) and some categorical independent variables (each of them includes several items). I adopted the ...
3
votes
0answers
449 views

pre-post testing: paired nominal data with more than 2 categories

I have two groups of students who answered a question on the pre-survey about their savings behavior, i.e. choose one answer a/b/c/e/d/f: (a) Save the same amount each week, (b) Save varied amount ...
3
votes
0answers
98 views

American Football Statistical Analysis Offense Breakdown: Bayesian? Poisson?

I have asked around my local network, but no one seems to be able to point me in the right direction. I was a High School football coach for about 10 years, but now I am self employed and am doing ...
3
votes
0answers
33 views

How does the size of my sampling grid affect my required sample size

I would like to know how sample size estimation is affected when the categories are artificial rather than naturally occurring and clearly discrete. In my scenario I'm using a grid of a certain size ...
3
votes
1answer
925 views

Handling of categorical variables: rpart vs tree

For tree and randomForest packages in R, the number of levels for a factor (as a categorical variable) is capped at 32. An explanation might be that the number of comparisons at each split becomes ...
3
votes
0answers
376 views

Latent Class Analysis: What's the difference between polytomous vs. dichotomous manifest variables?

I am using poLCA in R to run a latent class analysis (LCA), and I'd like some help understanding the implications of using polytomous vs. dichotomous manifest ...
3
votes
0answers
2k views

Encoding of categorical variables for machine learning: binary vs. one-hot followed by PCA

Edit: changed the title, removed call for opinions This post compares several methods of encoding categorical data. Binary encoding (convert categories to integers, then to binary; assign each digit ...
3
votes
0answers
421 views

Measure association in contingency table based on repeated measures?

I would like to show that/whether there is an association between two categorical variables shown in this frequency table (Code to reproduce the table at the end of the post): ...
3
votes
0answers
17 views

What is the relationship between objscores and pcscores outcome values from princals {Gifi}?

I am going to use the output of princals as the IVs in a regression with my DV. What is the relationship between objscores and pcscores outcome values from princals {Gifi}? Which one of objscores ...
3
votes
0answers
405 views

Principal component regression (PCR) with some of the original predictors left out of PCA

I just recently started learning about principal component regression (PCR) and I'm wondering if it's possible to use both principal components and original variables as predictors of a given outcome (...
3
votes
0answers
64 views

How should three unordered categories be encoded in a bayesian network framework?

The SAS FAQ suggest that for unordered two categories I should one dummy variables, for example: The common practice of using target values of .1 and .9 instead of 0 and 1 prevents the outputs of ...
3
votes
0answers
268 views

Variance explained - equivalent statistics for categorical data?

I have a multinomial response variable and a multinomial "independent" variable. Is there an equivalent statistics or method for calculating the variance explained by the independent variable?
3
votes
0answers
225 views

Sample size for multinomial distribution

Suppose we have multinomial distribution with $k$ outcomes having the same probability $1/k$. What sample size do we need to guarantee with the probability $95\%$ that $m$ of the oucomes occur at ...
3
votes
0answers
58 views

What is the best way to simultaneously fit multiple binomial and continuous predictors?

What is the most efficient way to fit a linear model w so that Y = w . X, where X is a ...
3
votes
0answers
103 views

Correlation among nominal variables

I have a small group of 27 patients bearing a total of 2700 cancer polymorphisms (gene variations of one nucleotide) which can be divided to almost 60 genes. That gives me a 60x27 table where it can ...
3
votes
0answers
48 views

Test independence categorical variables in genomic data

I have a question regarding testing the independence of two categorical variables in biology. I’ll first explain it in biological terms and then more generally. I have a list of down regulated loci ...
3
votes
0answers
158 views

Convergence diagnostics for binary variables

I am running MCMC for binary/categorical variables. I know that a decent method to check for convergence is to look at the traceplot of the variance, but I don't know a good citation for this. Does ...
3
votes
0answers
1k views

Best subset selection with categorical data

I am studying a dependent variable Y with 4 predictors: 2 of them are categorical (with 6 and 7 levels) and 2 numeric. I have used the best subset selection for ...
3
votes
0answers
99 views

Profiling survey respondents with both categorical and ordinal variables

I have a mixture of categorical and ordinal variables from a survey that I am trying to use to create "profiles" or segments that differ from one another with respect to a dependent variable (the ...
3
votes
0answers
305 views

How does the presence of factors affect the interpretation of the other coefficients in a regression?

The answer to Interpreting coefficients of an interaction between categorical and continuous variable contains a phrase that seems to have some significant impact on how coefficients are interpreted ...