Category "lm"

Cohen's f2 in R

Does anyone know how to extract the cohen's f2 effect size value from a model computed with the lm() function in R? I would like to report effect sizes for indi

How to exclude NA values in lm function (regression)?

I am doing a regression analysis with 70 countries. My dependent variable is 'Inequality' and my independent variable is 'Sanction'. My original columns look as

Why does lm generate NA for each independent variable?

I tried to make a linear regression with the lm function, but the output is NA for every independent variable. The dataframe is numeric. I have already tried t

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 wondering what is the easiest way to obtain RMSE out of l

Extracting coeftest results into a data frame

I'm trying to extract model coefficients from R into a data frame that I can then combine into one large dataset with some other model results from Stata. Using

Using column numbers not names in lm()

Instead of something like lm(bp~height+age, data=mydata) I would like to specify the columns by number, not name. I tried lm(mydata[[1]]~mydata[[2]]+mydata[[3]