Posts

Showing posts with the label build

Transfer of respiratory pathogens Drop size–dependent infectivity (ASIDE)

PROFESSOR: So let's build on this concept of diffusion of virions in droplets to understand how we would expect a size dependent infectivity of virions in different sized droplets. So an important concept in epidemiology that we will come to later is the infectivity, which is the probability that if a virion is transferred that it actually causes an infection in the host. That can be further broken down into a product of two probabilities. The first is that if the virus has escaped from the droplet, it actually causes an infection. And that's perhaps something which is roughly constant. It has to do with the physiology of the host. But then there is the escape of the virion from the droplet. And as we've already discussed, that's a strongly size dependent quantity. And from very large droplets, it's very difficult in a mucus droplet, especially, for the virion to diffuse out in a reasonable amount of time. And in fact, virions are typically found to ha...

4.3.15 Healthcare Costs - Video 8 Predicting Healthcare Cost in R

In this video, we'll build a CART model to predict healthcare cost. First, let's make sure the packages rpart and rpart.plot are loaded with the library function. You should have already installed them in the previous lecture on predicting Supreme Court decisions. Now, let's build our CART model. We'll call it ClaimsTree. And we'll use the rpart function to predict bucket2009, using as independent variables: age, arthritis, alzheimers, cancer, copd, depression, diabetes, heart.failure, ihd, kidney, osteoporosis, and stroke. We'll also use bucket2008 and reimbursement2008. The data set we'll use to build our model is ClaimsTrain. And then we'll add the arguments, method = "class", since we have a classification problem here, and cp = 0.00005. Note that even though we have a multi-class classification problem here, we build our tree in the same way as a binary classification problem. So go ahead and hit Enter. The cp value we're...

2.4.4 R2. Moneyball in the NBA - Video 3 Points Scored

So now let's build an equation to predict points scored using some common basketball statistics. So our dependent variable would now be points, and our independent variables would be some of the common basketball statistics that we have in our data set. So for example, the number of two-point field goal attempts, the number of three-point field goal attempts, offensive rebounds, defensive rebounds, assists, steals, blocks, turnovers, free throw attempts-- we can use all of these. So let's build this regression and call it PointsReg. And that will just be equal to lm of PTS regressing on all those variables we just talked about. So X2PA for two-point attempts, plus X3PA for three-point attempts, plus FTA for free throw attempts, AST for assists, ORB offensive rebounds, DRB for defensive rebounds, TOV for turnovers, and STL for steals. And let's also throw in blocks, BLK. Okay. And as always, the data is from the NBA data set. So we can go ahead and run this com...