All Questions
Tagged with dummy-variables or categorical-encoding
851 questions
2
votes
1
answer
58
views
Data categorization
I have categorized my education dataset for the analysis below. However, I have one occurrence of a respondent who attended a Missionary school that I do not know its level and I am unsure where to ...
2
votes
0
answers
45
views
Dropped variable in regression output in R
I am running a linear regression trying to predict an outcome y that is a numeric, continuous variable based on a variable with three levels (A,B,C) and three more variables that represent the ...
4
votes
1
answer
86
views
Creating a dummy variable when the continuous variable is equal to 0
I'm actually trying to find the best explanatory variables in order to estimate the probability of deafult of the counterparties of my portfolio. After defined the Long List of variables, I'm testing ...
5
votes
2
answers
109
views
How to calculate the reference level interaction in regression in R?
I am very confused on calculating the reference level interaction in regression in R.
Here is the sample code:
...
0
votes
0
answers
17
views
Encode & normalize features limited in range before or after split
I want to train a classifier on music data which contains a limited set of features which are all constrained in range:
...
0
votes
0
answers
27
views
Ordinal vs one-hot encoding when all features are categorical
Dealing with categorical data is not as straightforward as dealing with continuous data, since all ML algorithms expect their input in a numeric format. As such, when our features are categorical in ...
2
votes
1
answer
49
views
Dummy encoding for the multinomial response variable
I am reading about multinomial response models from the book Multivariate Statistical Modelling Based on Generalized Linear Models by Fahrmeir and Tutz. I am trying to understand the following ...
0
votes
1
answer
35
views
Problems with Dummy Categorical Variable Coding in Logistic Regression [duplicate]
I am using SPSS 26. Whenever I conduct a binary logistic regression, the first group of the categorical independent variable does not get dummy coded, and thus, does not get included in the model. In ...
3
votes
1
answer
109
views
Sum to zero contrast that makes it easy to express equal uncertainty about each factor level
How do I need to set-up a sum-to-zero contrast so that it is easy to express equal uncertainty about each factor level? E.g. when I go with the default offered by R such as:
...
2
votes
2
answers
94
views
Recreate `lm` Categorical Regression
Consider the code, which contains regression using lm of two categorical and one continuous variables without interaction using data from the correct model:
...
0
votes
0
answers
38
views
Normalizing the embedding space of an encoder language model with respect to categorical data
Suppose we have a tree/hierarchy of categories (e.g. categories of products in an e-commerce website), each node being assigned a title. Assume that the title of each node is semantically accurate, ...
0
votes
0
answers
51
views
Multiple Dependent Variables, One Independent - with dummy variables
I am trying to run regression models and don't know what type of regression to be running.
I have one independent variable (binary variable) and 8 dependent variables (3 discrete, 3 categorical, 2 ...
0
votes
0
answers
44
views
Is the intercept of a complex sum-coded regression basically useless for interpretation? Maybe even for some simple models?
In regression analysis, one may choose to code categorical variables differently depending on interpretability considerations. One such coding scheme known as sum coding (a kind of effect coding ...
0
votes
0
answers
27
views
Understanding softmax as an activation function, and sparsity in data and gradients
I’m working on a project that includes a probabilistic model that uses one hots, and also occasionally partially freezes weights or zeros gradients to specific regions of the weights. In some parts of ...
3
votes
1
answer
87
views
What is the connection between lift and logistic regression?
I have noticed that there is an interesting connection between two (apparently different) measures. I am under a market basket analysis framework (aka frequent itemset mining, both are common names) , ...
0
votes
0
answers
22
views
Firm Fixed Effects Model dropping Sector Dummies? Potential Solution?
For my thesis, I am using panel data with stock returns and other firm data. I first used an event study to calculate abnormal returns (with event window of 7 days so 7 observations for 500 firms) ...
0
votes
1
answer
57
views
Indicator variables/treatment variables as an independent variable?
Can a dummy variable or treatment variable be an independent variable? My independent variable take the value 1 if a flood occurs in a specific country in a specific year and 0 if no flood happens. ...
0
votes
0
answers
12
views
Regression model on edge list
I would like to fit a regression in which my data is links (edges) from the network and the output is weight of each link.
Income level is a node attribute and for each link two nodes are involved, so ...
0
votes
0
answers
34
views
Why does removing the offset change the F-statistic of an anova model in R?
When a linear model with only a single categorical variables is defined without an offset, the F-statistic reported by summary() and ...
1
vote
1
answer
192
views
Small sample in categorical explanatory variable vs overall sample size
In a statistical model e.g. regression, we have to ensure the sample size is sufficient to estimate a given number of parameters. Rules of thumb e.g. n=10 per parameter, or a power analysis, will ...
4
votes
2
answers
280
views
Interpretation of dummy-coded variable
I have a dummy variable, with 1 meaning the years in which an historical event took place and 0 meaning the years in which it didn't take place. I used 0 as the reference category. When the regression ...
2
votes
1
answer
85
views
Regression with single-observation dummies: F-test under heteroskedasticity
I have a linear regression model with an intercept and a few dummy variables. Each of the dummies indicate a single observation, so the fit is perfect for these observations. Having fit the model, the ...
3
votes
1
answer
284
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 ...
0
votes
0
answers
15
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 ...
3
votes
1
answer
45
views
Logistic regression in R: Handling mixed numerical and categorical variables
I'm attempting to fit a logistic regression model in R and need some guidance on handling both numerical and categorical variables simultaneously, especially when looking for significant explanatory ...
0
votes
0
answers
28
views
Should I include a dummy variable for groups with few observations?
I am doing some analysis of US Senate races and in my regression I'm wondering if I should include a (party X state) indicator variable that essentially measures the average vote for the two major ...
0
votes
1
answer
49
views
logistic regression with dummy regressors
I'm considering a logistic regression of $Y$ on $X_1,...,X_K$ where $X_1,...,X_K$ are all dummy variables. I'm wondering if the MLE of such a logistic regression is statistically valid since non of $X$...
0
votes
0
answers
36
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. ...
1
vote
0
answers
30
views
Calculating Expectation using the Linearity of Expectation law and sum of indicator random variables
I'm attempting to complete the problem sets for the Stanford CS109 Statistics course from 2021 as I follow along with the lectures.
I'm stuck on a particular problem in one of these problem sets. I ...
2
votes
2
answers
134
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 ...
0
votes
3
answers
1k
views
How to choose reference category of predictors in logistic regression? [duplicate]
I am struggling to decide which reference category I should define in my logistic regression model. When I define "mandatory school" as a reference in the variable education the results seem ...
4
votes
2
answers
398
views
Interpreting when a regression coefficient is significant
Consider the following regression model:
$y_i=\beta_1+\beta_2x_{i,2}+\beta_3x_{i,3}+\beta_4x_{i,2}x_{i,3}+\epsilon_i,$
where $\epsilon_i\sim N(0,\sigma^2).$ Here, $x_2$ is binary variable
$$X_2 =
\...
6
votes
1
answer
91
views
How to identify parameters to test asymmetric effect in a structural model
I am estimating an likelihood function (a structural model). A part of the likelihood function is that
$$
p_t=p_{t-1}k_1+x_t(1-k_1) \quad if \ x_t=1
$$
$$
p_t=p_{t-1}k_2+x_t(1-k_2) \quad if \ x_t=0
$$
...
0
votes
0
answers
74
views
How to get an overall P-value for a categorical variable, If I know the t-values of its dummy variables?
I am doing ANCOVA: main categorical variable for the comparison is "Street" and it contains 3 categories (Street1, Street2 and Street3). The outcome variable is social interaction time (...
0
votes
0
answers
12
views
Question about the effects of cardinality changing on the model's training
I'm analyzing a dataset that contains a feature 'street_name' with 5980 unique values. I used the LeaveOneOutEncoder class for encoding, but I noticed that the cardinality reduced a lot. There are now ...
4
votes
2
answers
125
views
Interpreting main effects with dummy coded and continuous predictors in regression
I have a logistic regression predicting probability of a 'yes' response given 'condition' (A,B,C,D; dummy coded, with 'A' as the reference level).
This will produce estimates for the following:
...
1
vote
0
answers
40
views
How do I regress income quartiles against each other?
I'm looking to find out whether an attitude differs across income quartiles. My supervisor has mentioned dummy coding and regressing the quartiles against each other, however, I'm sort of at a loss as ...
0
votes
0
answers
31
views
How should I deal with an ordered logit model with numerous, mutually exclusive dummy variables?
I an trying to estimate an ordered logit model where the DV is a likert-scale response (1-5) and I have 6 independent dummy variables representing whether an observation belongs to one of six mutually-...
0
votes
2
answers
60
views
OLS Residuals sum to zero for each submodel for a model with categorical variable?
I understand that in OLS regression, the sum of the residuals for the entire model must be zero. However, does this property also guarantee that the sum of residuals within each subgroup defined by a ...
1
vote
0
answers
23
views
Scalable unordered category encoders
I am trying to design a neuron network for an scalable target assignment problem and use RL to train it by reward feedback. My major concern is making the neuron network somehow adaptable to different ...
1
vote
2
answers
62
views
Interpretation dummy variables Cox PH model
I'm curious about interpreting the coefficients of dummy variables within a Cox Proportional Hazards (PH) model. Consider a scenario where I have a sample comprising both male and female patients, and ...
1
vote
2
answers
87
views
Number of Phones in a word: Numerical or Categorical Data?
I'm trying to model a subset of the MALD dataset (language related) using Gaussian Distribution.
MALD: https://link.springer.com/article/10.3758/s13428-018-1056-1
One of the variables I'm working with ...
1
vote
1
answer
92
views
Interpretation coefficients categorical variables
I am working with a large panel dataset studying many companies over a long period of time. Some of these companies receive a negative outlook from an analyst during the sample period. Similarly, some ...
2
votes
1
answer
58
views
Can we have intercept in this model: mutually non-exclusive factors
Imagine we have an experiment, where each subject consumes 2 out of 3 different kinds of chocolate bars (Mars, Snickers, Bounty) and we measure blood sugar subsequently, that is, after 2 of the bars ...
3
votes
1
answer
541
views
Ordinal vs multinominal classification in XGboost: differences in one-hot encoding
I have followed this post and tried to see if there will be any difference in predicted probabilities if I use different one-hot encoding in XGboost.
This is my code with some dummy data, which is ...
4
votes
1
answer
278
views
Should I remove the intercept when I have one dummy variable that covers all the categories in a categorical variable?
I have a categorical variable that has $4$ categories, and I have two dummy variables, $x_1$ and $x_2$, that cover this categorical variable. The $x_1$ variable has values of only $1$ without any ...
0
votes
1
answer
57
views
Interaction with dummy variable: How to access std. error, t value, p value, (and others) for the opposite manifestation of dummy
Preparation
Using R-Libraries: library(dplyr)
The situation
Data
Given the data
...
1
vote
1
answer
20
views
Can I add more than 2 independent groups to an Ancova and if so, do I need to create dummy variables in SPSS
I want to analyze the difference between 4 groups on one dependent variable while controlling for my covariate, age, and 3 different independent variables (sex, cancer type, metastasis) in SPSS. Can I ...
2
votes
1
answer
49
views
Interaction with dummies - 2 distinct models
What exactly is the difference between those two models:
model 1:
$Income_i = \beta_0 + \beta_1 \text{female}_i + \beta_2 \text{experience}_i + \beta_3 \text{female}_i \cdot \text{experience}_i + u_i$
...
3
votes
1
answer
137
views
Dummy Variable Trap & Interaction Term?
Suppose we create a dummy variable male (1=male, 0=female) and dummy variable female (1=female, 0=male). Does the dummy variable trap, also occur, if we include them into interaction terms:
$Y_i = β_0 ...