Categorical data can take on a "limited" (usually fixed) number of possible values. Not to be confused with `factor-analysis`.

learn more… | top users | synonyms (3)

26
votes
4answers
5k views

Does it ever make sense to treat categorical data as continuous?

In answering this question on discrete and continuous data I glibly asserted that it rarely makes sense to treat categorical data as continuous. On the face of it that seems self-evident, but ...
25
votes
3answers
12k views

Can principal component analysis be applied to datasets containing a mix of continuous and categorical variables?

I have a dataset that has both continuous and categorical data. I am analyzing by using PCA and am wondering if it is fine to include the categorical variables as a part of the analysis. My ...
17
votes
2answers
738 views

How to visualize an enormous sparse contingency table?

I have two variables: Drug Name (DN) and corresponding Adverse Events (AE), which stand in a many-to-many relation. There are 33,556 drug names and 9,516 adverse events. The sample size is about 5.8 ...
12
votes
3answers
186 views

Is building a multiclass classifier better than several binary ones?

I need to classify URLs into categories. Say I have 15 categories that I'm planning to zero down every URL to. Is a 15-way classifier better? Where I have 15 labels and generate features for each ...
11
votes
2answers
580 views

Alternative to sieve / mosaic plots for contingency tables

I once stumbled across a type of plot for categorical data (i.e., contingency tables) on the internet, which I really liked, but I've never found it again, and I don't even know what it's called. It ...
10
votes
4answers
1k views

How to summarize categorical data?

I've been struggling with the following problem with hopefully is an easy one for statisticians (I'm a programmer with some exposure to statistics). I need to summarize the responses to a survey (for ...
9
votes
2answers
895 views

Methods for merging/reducing categories in ordinal or nominal data?

I'm struggling to find a method for reducing the number of categories in nominal or ordinal data. For example, let's say that I want to build a regression model on a dataset that has a number of ...
8
votes
6answers
2k views

How to find summary statistics for all unique combinations of factors in a data.frame in R?

I want to calculate a summary of a variable in a data.frame for each unique combination of factors in the data.frame. Should I use plyr to do this? I am ok with using loops as opposed to apply() ; so ...
8
votes
1answer
244 views

What are the different types of codings available for categorical variables (in R) and when would you use them?

If you fit a linear model or a mixed model there are different types of codings available to transform a categorical or nominal varibale into a number of variables for which paramaters are estimated, ...
7
votes
1answer
674 views

Is it possible to create “parallel sets” plot using R?

Thanks to Tormod question (posted here) I came across the Parallel Sets plot. Here is an example for how it looks: (It is a visualization of the Titanic dataset. Showing, for example, how most of ...
7
votes
3answers
710 views

What to do with almost-continuous variable in regression?

I've been taught that binning a continuous variable into categories is almost never a good idea, because you lose information in the process. But now I'm facing a situation where I have an age ...
7
votes
2answers
164 views

How to model number of days in the last week smoking cigarettes (0 to 7 - 'U' shaped)?

I am currently analysing data where the outcome variable is 'U' shaped. The outcome variable asks 'how many of the last seven days have you smoked'. Most responses to this fall in the first (none) and ...
6
votes
4answers
2k views

How to implement dummy variable using n-1 variables?

If I have a variable with 4 levels, in theory I need to use 3 dummy variables. In practice, how is this actually carried out? Do I use 0-3, do I use 1-3 and leave the 4's blank? Any suggestions? ...
6
votes
6answers
1k views

How to handle count data (categorical data), when it has been converted to a rate?

I am working on disease infection data, and I am puzzled on whether to handle the data as "categorical" or "continuous". "Infection Count" the number of infection cases found in a specific period ...
6
votes
2answers
2k views

Quickly evaluate (visually) correlations between ordered categorical data in R?

I'm looking for correlations between the answers to different questions in a survey ("umm, let's see if answers to question 11 correlate with those of question 78"). All answers are categorical (most ...
6
votes
2answers
213 views

Best practices when treating range data as continuous

I am looking at whether abundance is related to size. Size is (of course) continuous, however, abundance is recorded on a scale such that ...
6
votes
5answers
546 views

How to rank the results of questions with categorical answers?

I'm working with the results of a survey which has multiple questions. All answers (in this case) are categorical and ordinal (such as very unhappy, unhappy, neutral, happy, very happy). I'm looking ...
6
votes
3answers
609 views

Testing paired frequencies for independence

I hope this isn't either far too basic or redundant. I have been looking around for guidance but so far I am still uncertain of how to proceed. My data consists of counts of a particular structure ...
6
votes
3answers
4k views

Multiple Chi-Squared Tests

I have cross classified data in a 2 x 2 x 6 table. Let's call the dimensions response, A and ...
6
votes
3answers
268 views

Can categorical data only take finitely or countably infinitely many values?

I wonder if categorical data by definition can only take finitely or countably infinitely many values? And no more i.e. not uncountably many values? Related question: is the distribution of a ...
6
votes
2answers
846 views

How to choose number of dummy variables when encoding several categorical variables?

I'm building a logistic regression, and two of my variables are categorical with three levels each. (Say one variable is male, female, or unknown, and the other is single, married, or unknown.) How ...
6
votes
1answer
389 views

Should I run separate regressions for every community, or can community simply be a controlling variable in an aggregated model?

I am running an OLS model with a continuous asset index variable as the DV. My data is aggregated from three similar communities in close geographic proximity to one another. Despite this, I thought ...
6
votes
3answers
498 views

Appropriate way to deal with a 3-level contingency table

I have a three level contingency table, with count data for several species, the host plant from which they were collected and whether that collection happened on a rainy day (this actually matters!). ...
6
votes
2answers
256 views

Measures of autocorrelation in categorical values of a Markov Chain?

Direct Question: Are there any measures of auto-correlation for a sequence of observations of an (unordered) categorical variable? Background: I'm using MCMC to sample from a categorical variable ...
6
votes
3answers
345 views

Which logit/probit model do I use for multiple reponse/dependent variables?

I have $300$ time series objects that constitute the $300$ columns of matrix $X$. This matrix has $5$ rows and represents $5$ days of time series information for each $300$ columns. I set up a ...
6
votes
1answer
257 views

CART (rpart) balanced vs. unbalanced dataset

I am fitting a tree (CART) to the olives-dataset. The training data has 436 observations (test data: 136). I have 3 responses (the 'Region' variable) which splits the training data into 116 / 74 / 246 ...
5
votes
2answers
3k views

How to transform ordinal data from questionnaire into proper interval data?

Are there any straightforward methods of transforming ordinal level data into interval level (just as there are for doing it the other way round)? And performable in Excel or SPSS? Having the data, ...
5
votes
2answers
1k views

Yates continuity correction for 2 x 2 contingency tables

I would like to gather input from people in the field about the Yates continuity correction for 2 x 2 contingency tables. The Wikipedia article mentions it may adjust too far, and is thus only used in ...
5
votes
1answer
175 views

Including day of week in a logit model

Let's say that I am putting together a logistic regression model where I am predicting something (y) based on the day of the week. However, the model needs to account for each single day. Therefore, ...
5
votes
1answer
177 views

Non-intuitive answer from a Poisson regression

I am not very familiar with Poisson regression, so I think I must have made a mistake in the below analysis: I am studying the effects of smoking on lung cancer rates. The dataset is provided here. ...
5
votes
3answers
228 views

How to compare two groups on a measure of social skills that includes 5 subscales where each subscale is number correct out of 12?

I have two groups of participants. Each group contains 30 children (15 girls and 15 boys). The first group has been sampled from a population of children being raised under some kind of constitutional ...
5
votes
1answer
132 views

Analyzing changes in a repeated categorical measure

I am trying to analyze why some individuals change their response to a categorical survey item Y between time T1 and T2, given some explanatory variables X1 and X2 Specifically, the data looks like ...
5
votes
2answers
529 views

Is multicollinearity implicit in categorical variables?

I noticed while tinkering with a multivariate regression model there was a small but noticeable multicollinearity effect, as measured by variance inflation factors, within the categories of a ...
5
votes
1answer
484 views

Calculating predicted values from categorical predictors in logistic regression

Context: I am working with an ordinal logistic model and trying to interpret/present the results. The model has two continuous predictors of interests, and a mix of continuous and categorical ...
5
votes
1answer
382 views

How can I use optimal scaling to scale an ordinal categorical variable?

In an answer to this question about treating categorical data as continuous, optimal scaling was mentioned. How does this method work and how is it applied?
5
votes
1answer
139 views

Do you include a reference category for a series of dummy variables in a probit regression?

Do you include a reference category for a series of dummy variables in a probit regression? If so, how would you interpret the reference category? The question underlying my confusion is that I don't ...
5
votes
1answer
502 views

What is the advantage of transforming variables from nominal to ordinal/numerical when it reduces variance explained in CatPCA?

Context I have a dataset of 8 categorical variables. And I want to apply Categorical Principal Component Analysis (CatPCA). Before doing that, I have been advised to look at the transformation plots ...
5
votes
1answer
460 views

Alternatives to multinomial logistic regression

I have been using a multinomial logistic regression to examine the correlates of school choice. There are three possibilities for the dependent variable: government school, private school, and NGO ...
5
votes
1answer
413 views

How to visualize both total counts of categories and proportions of subcategories in a plot?

Suppose I have samples drawn from categories A, B, C. Within those categories, I have subcategories d,e,f which are found in all 3 categories. I want to visualize how many samples I have form ...
5
votes
1answer
368 views

If a factor variable is to be dropped in model selection, should all levels be dropped simultaneously? If so, why?

In answer to a previous question factor pooling in model selection was discussed. If a factor or categorical variable is to be dropped in model selection, should all levels be dropped simultaneously? ...
5
votes
1answer
502 views

Effect size of Cochran's Q

I have performed a Cochran's Q test for a within-subjects experimental design with 3 conditions and 36 participants with a dichotomous dependent variable. I found a (just) statistically significant ...
5
votes
1answer
432 views

Is there a version of multivariate multinomial logit?

I'm working with a data set with 2-3 response variables and 7 predictor variables. All the variables are categorical. If there were just one response variable, I think a multinomial logit would be the ...
5
votes
3answers
589 views

How to control for market return in an (SPSS) OLS?

Please consider the following panel dataset: ...
5
votes
1answer
167 views

What test should I choose if I want to see if two groups are different from each other in many categories?

I am currently analysing data of a big webshop with over 31,000 vendors selling goods, i.e. each vendor is selling items over the webshop. The cool thing is that we know the gender of these vendors ...
5
votes
1answer
1k views

Generalized estimating equations output in SPSS

I am hoping to confirm that I have a suitable way to analyse the different proportions of people who are categorized as left lateralised on the one hand, or bilateral/right lateralised on the other in ...
5
votes
2answers
394 views

Which statistical test should I use for my experiment on aggressive interactions in killifish?

I am doing a project on sexual selection (male-male competition) in the turquoise killifish Nothobranchius furzeri. There are two morphs of male in the population from which my fish are obtained ...
5
votes
2answers
3k views

Continuous and Categorical variable data analysis

I have three variables: distance (continuous, variable range negative infinity to positive infinity) isLand (discrete categorical/ Boolean, variable range 1 or 0) occupants (discrete categorical, ...
4
votes
3answers
214 views

What is the best way to visualize relationship between discrete and continuous variables?

What is the best way to show a relationship between: continuous and discrete variable, two discrete variables ? So far I have used scatter plots to look at the relationship between continuous ...
4
votes
4answers
336 views

Incorporating boolean data into analysis

I have a data set of about 3,000 field observations. The data collected is divided into 20 variables (real numbers), 30 boolean variables, and 10 or so look up variables and one "answer" variable ...
4
votes
2answers
258 views

How to handle both text and numbers for PCA in R?

I'm relatively new to R and am working with a very large dataset that has a mix of numerical scores (for instance, household income) as well as text values (i.e. race). I was planning on using PCA to ...

1 2 3 4 5 8