Top "Lm" questions

The lm function is used to fit linear models in R. It can be used to carry out regression, single stratum analysis of variance and analysis of covariance.

lm function in R does not give coefficients for all factor levels in categorical data

I was trying out linear regression with R using categorical attributes and observe that I don't get a coefficient value …

r linear-regression lm
Predict.glm not predicting missing values in response

For some reason, when I specify glms (and lm's too, it turns out), R is not predicting missing values of …

r prediction missing-data glm lm
How to predict x values from a linear model (lm)

I have this data set: x <- c(0, 40, 80, 120, 160, 200) y <- c(6.52, 5.10, 4.43, 3.99, 3.75, 3.60) I calculated a linear model using lm(): …

r lm predict
Using lm and predict on data in matrices

I use R only a little bit and never use data frames, which makes understanding the correct use of predict …

r dataframe lm predict
R: cannot predict specific value

> age <- c(23,19,25,10,9,12,11,8) > steroid <- c(27.1,22.1,21.9,10.7,7.4,18.8,14.7,5.7) > sample <- data.frame(age,steroid) > fit2 &…

r linear-regression prediction lm
Finding where two linear fits intersect in R

I have two linear fits that I've gotten from lm calls in my R script. For instance... fit1 <- …

r intersection lm
How to perform lm.ridge summary?

I wonder is there a way to output summary for ridge regression in R? It is a result of lm.…

r regression lm summary
Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) with an obviously correct dataset

I encountered a problem in R when trying to run a simple linear model with a categorical variable as predictor. …

r lm
Linear model with categorical variables in R

I am trying to fit a lineal model with some categorical variables model <- lm(price ~ carat+cut+color+…

r lm factors
Fit line to data on a log scale in R

Basically, I don't know how to plot a line of best fit on my data once it's a logarithmic scale. …

r plot lm