From the course: Descriptive Healthcare Analytics in R

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Introduction to ANOVA and linear regression code

Introduction to ANOVA and linear regression code - R Tutorial

From the course: Descriptive Healthcare Analytics in R

Start my 1-month free trial

Introduction to ANOVA and linear regression code

- Hi there. Before we jump into coding, I just wanted to prepare you for what we will see when we run our ANOVA in Linear Regression Code. First, I'm going to talk about linear regression and ANOVA so I can more easily explain the lm code. That is because you actually use linear model code, or lm code, to get the ANOVA's to come out. Then I'll explain how to interpret the results. I'll give you insight on what to pay attention to and what to ignore. Just to remind you of what we are doing with bivariate tests with a categorical variable and a continuous variable, we are going to want to make sure we run ANOVA on three plus level variables and t-tests on two level variables. A quick review of our data dictionary on this topic shows we need t-tests only for SEX and for ASTHMA. The rest are all three levels at least. So that's what we'll do, two t-tests and a bunch of ANOVA's. Now this is kind of how it works in all statistical packages. You know how when you want to buy a swimsuit top…

Contents