Adam Gladstone continues a series on working with R in Excel via the ExcelRAddIn component:
In the first part of this series, I looked at using R in Excel to obtain descriptive statistics. In this second part of the series I am going to look at using R in Excel to perform linear regression, specifically using the
lm()
function.lm()
is a real workhorse function. It can be used to carry out both single and multiple regression and different types of analysis of variance. For this demonstration I will only focus on single and multiple regression.The workbook for this part of the series is: “Part II – R in Excel – Linear Regression.xlsx”. As before, the ‘References’ worksheet lists links to external references. The ‘Libraries’ worksheet loads additional (non-default) packages. In this demonstration, I use the
datarium
andbroom
packages. The ‘Datasets’ worksheet contains the data referenced in the worksheets.
Click through to see how you can perform ordinary least squares regression, multiple linear regression, and even logistic regression in Excel with a bit of R code. H/T R-Bloggers.
Leave a Comment