To demonstrate logistic regression in R, we will continue to use the fake dataset of myocardial infarction (MI) survivors. Notice the following features of the output: Here’s an example with AgeAtPres added to the equation: In SAS, I always compare nested models with -2 log likelihoods (considering df) with a chi-square test to decide if
There are some important differences between SAS and other proprietary statistics software, and R, which is free and open source. The penalty for this is that, in R, it seems like you are always installing packages. As soon as you try to run some fancy code, R complains it is missing a package. I found
We will continue working with our dataset of fake people who survived a myocardial infarction (MI). These fake people are going to fake cardiovascular clinics in the Twin Cities area of Minnesota, so they are either going to the Minneapolis location (MPLS) or the St. Paul location (STP). In a previous video, we created the
To do survival analysis in R, you need two variables: A yes/no (1/0) flag that says whether or not the person got the event, and A time variable that says how long it took for them to get the event if they got it, or how long they were followed-up if they didn’t get it.