Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
1 answer
241 views

Understanding the process of tweaking contrasts in linear model fitting to show all levels

The accepted answer to this question on SO accomplishes exactly what I need: Comparing all factor levels to the grand mean: can I tweak contrasts in linear model fitting to show all levels? However, I ...
Adam_G's user avatar
  • 371
2 votes
0 answers
52 views

How to combine 2 ordinal variables?

I have an assignment that gives two ordinal variables: Education (1-poor, 2-medium, 3-high), Wealth (1-poor, 2-medium, 3-rich). The chi-square test rejects the independence of these 2 variables, so my ...
Phuong Dinh's user avatar
0 votes
1 answer
307 views

How to write a regression formula with dummy variables

my regression is relatively simple. I have a dependent variable, age (A), and its values for 8 types of employees (T) for 6 years (Y). I run it in R and get some meaningful results, which show how A ...
Mikhail's user avatar
  • 97
0 votes
1 answer
162 views

Interpreting categorical variables with reference level in linear model

I wonder how should I report the results of categorical variables with reference level in linear model? The response variable of my model is Duration (time taken to reach 25C for an animal model). My ...
Sammi 's user avatar
3 votes
0 answers
272 views

Is there a fundamental mathematical reason that ordered factors are represented as orthogonal polynomials in linear regression?

At least for R, Chambers/Hastie write in their book "Statistical Models in S" in chapter 2.3.2 "Coding Factors by Contrasts": Ordered factors are coded so that individual ...
Christoph's user avatar
  • 209
1 vote
2 answers
335 views

Why does removing intercept not change predicition of linear model in the precence of factor predictors? [duplicate]

In a linear model that predicts birth rate (TFR) per country from per capita GDP, the country is encoded in "treatment coding", and there are several measurements (different years) per ...
cdalitz's user avatar
  • 5,730
3 votes
2 answers
609 views

Why are models based on coded (-1,1 etc) and non-coded variables (as they are) very different? What should I use for publications?

I am doing factorial experiments in R. I noticed when I use my variables as they are vs. coding them into -1,1, they are all very different. Here is my sample code. ...
Deus Sema's user avatar
0 votes
1 answer
113 views

How do I interpret price elasticity when using state specific dummies and price, dummy interaction

I have price volume data for 3 states for which I want to calculate price elasticity for each state. The model has the following setup: $$ \ln(Y)=A_1+ A_2\ln(P) +A_3D_1 +A_4D_2+ A_5\ln(P)D_1 +A_6\ln(P)...
Sim's user avatar
  • 1
0 votes
1 answer
56 views

It is possible to use regression to measure the correlation between a continuous variable and a dummy variable?

I have 3 columns: one column is a continuous variable (e.g., age) and the other two columns represent dummy variables with values 1 and 0 (yes/no). What kind of regression do I have to use to measure ...
DOMEC's user avatar
  • 7
1 vote
0 answers
70 views

Interpreting the covariate p-values in a multivariate generalized linear model?

If a covariate in a GLM is "significant" does that mean it is significantly different from the base case (the group not shown)? Say we have three groups, Control, Exp1, Exp2. We are ...
neurostats6's user avatar
1 vote
0 answers
2k views

Can I use month as a numerical variable (and not as a categorical variable) in linear regression

Let's say my response is $Y$. I know for a fact that $Y$ decreases during winter time, and then starts to increase around spring. So, does it make sense to use month (not as a categorical variable) as ...
Shashank's user avatar
1 vote
1 answer
1k views

Do I need to get dummies for "binary" categorical columns?

My question is about a multi-variate linear regression model. I am experimenting with Python's sklearn library with the Ames Housing data set: http://jse.amstat.org/...
Joachim Rives's user avatar
1 vote
1 answer
89 views

Can SAS Least Squares Means estimation algorithm be translated for a design matrix in Reference coding?

My question is whether it’s possible to compute lsmeans defined in this SAS algorithm if the design matrix is not in GLM form. In particular, in R, if one feeds that design to model.matrix(), then ...
James's user avatar
  • 2,754
1 vote
0 answers
3k views

Dummy variables and interactions

To avoid perfect multicollinearity, a common practice is to drop one dummy variable when encoding categorical variables in a linear regression model (avoiding dummy variable trap). I am using this ...
towi_parallelism's user avatar
0 votes
0 answers
27 views

Multiple linear regression with dependent as a dummy predictor

I have a model $Y = \alpha + \beta_1X_1 + \beta_2X_2$. $Y$ has a bimodal normal(ish) distribution, so I'm looking to see if the relationship between the predictors and the response is different for ...
user156060's user avatar
3 votes
3 answers
3k views

Multiple regression with dummy variables and interaction term

We have done a multiple regression analysis to see how gender and experience affect salary. We used a dummy variable for gender and then we also added the interaction variable (female work experience)....
user avatar
0 votes
1 answer
3k views

Coding categorical variables for linear regression and random forest, factors/characters

I am a newbie in Data Science so that do not judge me for this questions. Making a regression model (linear model, lm_model) with numeric and categorical variables, I realized that Estimate ...
Alex's user avatar
  • 31
13 votes
3 answers
35k views

Difference between fixed effects dummies and fixed effects estimator?

I started to read about panel regression models. However, I am a bit confused about the different model specifications in the fixed effects model: Does a fixed effects panel regression always mean ...
jeffrey's user avatar
  • 755