Linked Questions

0
votes
1answer
850 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 ...
1
vote
0answers
868 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 ...
0
votes
0answers
431 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 ...
0
votes
0answers
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 ...
0
votes
0answers
21 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: ...
104
votes
2answers
50k 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$ ...
17
votes
2answers
19k 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 ...
11
votes
2answers
16k 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 ...
1
vote
2answers
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 ...
5
votes
1answer
500 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 ...
1
vote
0answers
1k 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 ...
2
votes
1answer
172 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 ...
1
vote
0answers
69 views

Dealing with categorical variables in regression [duplicate]

I have this categorical variable that represents the country for a person. How can I use this in regression model. If there had been less levels for a category I could have used dummy binary variables ...
0
votes
1answer
32 views

compare frequencies between 6 samples

I'm new to statistics so this might be a really newbie question.. I have a table in R as such: ...