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.

Add fitted quadratic curve

I'm trying to add a fitted quadratic curve to a plot. abline(lm(data~factor+I(factor^2))) The regression which …

r lm
Plot fitted line within certain range R

Using R, I would like to plot a linear relationship between two variables, but I would like the fitted line …

r plot lm par
Fitting a function in R

I have a few datapoints (x and y) that seem to have a logarithmic relationship. > mydata x y 1 0 123 2 2 116 3 4 113 4 15 100 5 48 87 6 75 84 7 122 77 > …

r curve-fitting lm nls
How does predict.lm() compute confidence interval and prediction interval?

I ran a regression: CopierDataRegression <- lm(V1~V2, data=CopierData1) and my task was to obtain a 90% confidence …

r regression linear-regression prediction lm
Prevent NA from being used in a lm regresion

I have a vector Y containing future returns and a vector X contain current returns. The last Y element is …

r lm
predict.lm() with an unknown factor level in test data

I am fitting a model to factor data and predicting. If the newdata in predict.lm() contains a single factor …

r regression linear-regression lm
How to obtain RMSE out of lm result?

I know there is a small difference between $sigma and the concept of root mean squared error. So, i am …

r regression linear-regression lm
R error which says "Models were not all fitted to the same size of dataset"

I have created two generalised linear models as follows: glm1 <-glm(Y ~ X1 + X2 + X3, family=binomial(link=logit)) …

r glm lm anova
Running a stepwise linear model with BIC criterion

Is it possible to set a stepwise linear model to use the BIC criteria rather than AIC? I've been trying …

r lm
How to do a Tukey HSD test with the Anova command (car package)

I'm dealing with an unbalanced design/sample and originally learned aov(). I know now that for my ANOVA tests I …

r lm anova tukey r-car