2k views

### Why, oh why, does R automatically eliminate variables from my dataset when running lm? [duplicate]

First of all, forgive my moronosity (new word I made up). I am running R on data from trees in burn areas. Simple, straightforward dataset. And yet, R for some reason hates chestnut oak. My species ...
1k views

### glm for categorical data [duplicate]

I am currently running some GLM's looking at different carnivore species and environmental variables. One of my variables is habitat which I have coded from 1-6. I ran the models with Poisson, but I ...
579 views

### Cox proportional hazard for multiple groups - meaning? [duplicate]

I am studying the effect of expression of a specific gene signature on patient survival, dividing patients into Low, Mid, and High expression of Signature X. The survival curves for these patients all ...
34 views

### R Categorical Variable [duplicate]

When I fit a linear model in R with categorical variables of X (I have 3 levels). As R works it does not include one of these levels in the model output to avoid overfitting the model. But I need to ...
27 views

### Why not all contrasts showing up? [duplicate]

I have a categorical variable with 3 levels: low, mid, and high. I want to do all-pair comparisons with the following contrasts: ...
57k views

### Removal of statistically significant intercept term increases $R^2$ in linear model

In a simple linear model with a single explanatory variable, $\alpha_i = \beta_0 + \beta_1 \delta_i + \epsilon_i$ I find that removing the intercept term improves the fit greatly (value of $R^2$ ...
20k views

### Qualitative variable coding in regression leads to “singularities”

I have an independent variable called "quality"; this variable has 3 modalities of response (bad quality; medium quality; high quality). I want to introduce this independent variable into my multiple ...
18k views

### Regression based for example on days of week

I need a little help to move in the right direction. It's a long time since I studied any stats and the jargon seems to have changed. Imagine that I have a set of car-related data such as Journey ...
2k views

### Multicollinearity and the intercept term with categorial variables

We're given a regression equation with two dummy variables which are perfectly collinear. $$y_i = \beta_1 D1_i + \beta_2 D2_i + e_i$$ where $D2_i = 1-D1_i$. Can we estimate this model using least ...
585 views

### Is there something called “mean coding” (like dummy coding & effect coding) in regression models?

When we perform a regression analysis with categorical predictors, we can use (1, 0), called "dummy coding". The coefficients in this case represent the deviation of the groups' means from the mean of ...
2k views

### Using deviation coding (effect coding) of factors in glmnet LASSO in R

Various sources have instructed me how to use deviation coding (aka effects coding) in R (see here, here, and here). My question though, is how to go about doing this for LASSO regression using ...
198 views

### Defining NULL group for dummy variables

I am quite new in R and am on a stage of running a regression model there. The approach we have chosen is linear regression with dummy variables. As far as my knowledge and experience go when using ...