 Okay, um, well, this is my inaugural live chat here that I'm trying to set up so that um, I can live stream on Doing data analytics for you guys, which nobody is listening right now but Maybe if I keep Staying on here and doing analytics Somebody will join me. Okay. So what do I have here? I've been really quiet Of course, nobody's watching right like I wonder if I can tell if anybody's watching Let's see here. Can I tell? Let's see here. Yeah, one watching now, you know who that is That's me because I'm my biggest fan. I don't know But anyway, there's like significant leg and I can't tell if my chat is working So I'm just gonna have to track more people and see if it works. I guess I'm testing it in a live situation, which you're not supposed to probably do but You know me I just can't wait to get things organized and then now I Don't know. I don't even know if I have bots working. I don't even know. I don't know All right, but here's where we are is We're logged into the SAS University Edition so just to remind you of Because I think I'm recording this, you know, I'll put this up. Okay, so this is what SAS University Edition looks like So how do we get here? Right? Well first what you got to do is you've got let me go over here You got it down Or you got it. Let's see your SAS It's been a while since I did it You got to go to their web page, right? So here's the web page for SAS University Edition. It's not They try to make it look like it's really easy and they try to make it easy on you, but it's not really that easy. So I'm Windows, so I went over here. I did this a long time ago Like a month ago. That's not a long time ago But you can download these instructions, but I'm gonna just kind of explain to you what happens, okay? Is that you get this see I'm noticing this leg here now It's really kind of behind but anyway, this is the first time I've lost you so So first you have to get this virtualization software So basically first you have to download this virtual box for Windows So if you've ever used like a VPN Application where you run the VPN and then after you set up the VPN connection then you Go tunnel in and use whatever a server you were trying to use It's not exactly like that. Well, maybe it is exactly like that. I don't understand it. I understand it yet So it's kind of like that. You're basically downloading this application that runs a lot like a VPN Maybe it is a VPN. I don't even know so what it's called is and I'm running it now It's called Oracle Virtual box manager VM Virtual box manager. So what happens is this is its own program So you got to download and install that program and get it running and that I know they try to make it look like it's simple but if you're like me and you've installed like a million things on your Windows and your computers kind of old then sometimes it has a C++ issue and then you have to go and resolve that and So anyway, just getting that thing to run was its own issue, you know And so anyway, so once you get this to run What I want you to see is that this thing is running but I made that run like that's the next thing you have to do is you have to connect sass with it and Because what this is basically doing what sass university edition basically is it's a server out there That has sass on it That's running sass and that there's an interface for you to basically go to that server and put your Data on it now. That's some caveats because you know your data can't be that big but What I'm not going to complain because before sass university edition You really couldn't use sass like you had to be at a place that had sass because it's too expensive like My small business if I were to buy base sass and sass stat just so I could do regressions nothing fancy It would cost like over ten thousand dollars for one seat and so The fact that they have this university edition is great because then I can use it to teach and I don't have to pay like That's a ridiculous amount of money And but you know if I really wanted to use sass for like an actual project I can't use sass university edition because it's on someone else's server like let's say you give me your Personal data, you know, I can't put it on that server and also if you give me big data and more fits So um, so I'm not going to knock sass university edition We really needed it because I want to be able to demonstrate stuff and practice stuff And I don't have the money to buy all of that Um sass license, so I'm kind of an hour girl, but you got to be sort of like You got to be a person who um is willing to learn other software if you're gonna be a data scientist So here we are this is how you can learn sass. So what happened is I installed it and then um See how this is running here. Let me show you here. I Had to get it running I'm gonna right click this here. So see show pause reset close now when I'm done with my sass session today I'm gonna close this okay Not only because you're supposed to because it eats my processor. Okay, and that's a power off So what happened was when I started this session today, this is just my test run I I ran this virtual box and I Started this thing. Okay, so that was the first thing I did. So this has to keep running while I'm there and While it's running It's just open. Okay, and then I had to go over here After it was running I had to go up here to local host Actually, let's go over here and show them. Oh, I forgot you have to also download stuff I know it sounds like illogical that you have to download stuff Even though you're porting out to some server, but you do have to download stuff And you got to put it a certain place on your computer. So if you're like in the cloud or something You just got to pay attention what you're doing, right? And then when you go in you download all of the stuff. So this is actually sass you have to download That's not this It in my life sass takes a while to download, but maybe you'll go faster for you So you download it and it looks like you're buying it, but it's free So then you get it and so there's a lot of local files basically on your computer that you're running also with us So and so when you download it, that's how you import it into this box So that's how I got this here. Otherwise. This was blank before So you got to import it into the box and then um, I Guess you got to share my folders. I don't I can't really tell what happened here I can't remember doing this part and Then finally after you get all that set up and I think I'm going to do a blog post about it on my blog Because it's not that easy To set up and sometimes things go wrong like the first time I did it I did on my laptop and I did on my desktop when I did on my laptop I don't know. I had some trouble with that Oracle box and it didn't install right or it wasn't running right for a while And I was totally lost but then we got that fix um So then let's see here So then see this local host thing So that's what I did here is so once I got connected over here and oh here it is This window opened up when I started So, let me just show you this here when I started running this okay This window opened and it started looking like Emma Stoss, right and it just Did all this stuff like it used to do in the 80s. It was like traumatic for me and then um After that it it like settled into this Okay, which was fine. I just stopped looking at it. I'm so sick of the 80s So like then you go here and then you do start SAS studio and that's how I got here I mean I put all this up. So every time I log in now I get the same stuff here But I don't know whether to trust it or not. Okay, so this is how we got here So why am I here? Well, I'm here because I want to do some different um Tutorials using SAS University Edition because I've noticed that I teach R a lot in ours open source and everybody loves R but the problem is People don't really love SAS the way they love our like new people old people love SAS like You can tell I'm old right now because I use SAS right and I know how Um, I don't know. I have always had not the best relationship So I'll just be honest. I think deep down inside I'm really a sequel girl and It pains me to say that because I really am an Arab evangelist and I really like You know and SAS has gotten me out of a situation before more than one But you know, I I really and I don't I'm not even really that good a sequel I I just have to say that SAS and I We've had a storied relationship Right now what I'm trying to talk people into is seeing not seeing SAS as an abusive application but instead seeing it as a One that needs tender loving care. Okay, so why does SAS need tender loving care? Because it's kind of old Okay, and it can't go upstairs like it used to I guess I would say it that way and You know ours new fangled and it goes fast, but it can't handle the big data that SAS can So it's like you got to learn how to make all these things work together Even though they're not really meant to work together and you weren't really meant to do them all you just kind of have to go and Like use a strength-based approach where you look at the strengths of each of them and capitalize on that and and then just try to look past the issues because When SAS sings it sings beautifully But when there's issues, there's huge issues like they're very embarrassing and you'll see them Sometimes I just have to look away. I'm like, oh, they don't anything about that I'll sometimes when I'm running SAS. I'll be like, you know, they've invented artificial intelligence You know, but I I shouldn't say that because SAS was the first one there or whatever. All right So anyway, so we all need to learn about SAS Anyway, even if everything is in news and sequel in our there's history, right historical stuff is in SAS like You know, whenever I go to the airport and I see my first name Monica and my middle name Maya like scrunched right next to each other Like Monica Maya. I just think, you know They're still Fixed with databases out there as long as there's that there's gonna be SAS and probably Cobal and everything so So we should just get used to it. All right, so now I'm in SAS University Edition It's a mess because I made it and you can see I'm writing a book here And I'm About programming SAS so I've got some code but what I thought I guess maybe what we can do is talk about the issues of trying to get this Into SAS and actually I'm gonna bring up our to do that So normally so I just bragged about how awesome SAS is for Data analytics, right like big data analytics. So here's our I'm sorry. Here's the our console Okay, so why did I open our I opened our because in order to read the data set into SAS that I wanted to use for the demonstration for the book I'm writing I Couldn't do it. I Couldn't do it because even though the data set I was trying to put in SAS University Edition Started out in SAS. It was too big Now it's not too big for SAS It's too big for SAS University Edition servers that are restricted So I had to create a smaller version of the data set and I did it in there So here I'm gonna show you oops. I just opened this. I'm gonna map it to the directory where I put this stuff Let me go find that Okay, so I just mapped that and so now when I open the script it's gonna open go to my code directory here So here's some our code So you can see here. I've got all this our code. Um Like here this may chapter for data sets So as you can see in here, the first thing I did would be our FSS underscore eight underscore a stands for is BRFSS is a big data set. It's a big annual survey health survey in the US and there's for about 450,000 rows in and this is a big SAS data set You can download online. Actually, I can go And I mean, it's fun to do this but the thing is that They haven't asked in the same questions for so long that sometimes you wonder if they need a refreshment But anyway, see there's all these SAS data resources and this is literally the data set that I started with is this SAS transport format but admittedly, I Used are in other code to get it out of that Format and get it into a CSV So now I'm reading that CSV in so I'm calling it BRFSS a a Because eight stands for 2018 because I'm just lazy and a means. It's the first version. I'm reading it, right? So let's say that I read that in here And then let's see here So it's gonna take a little while but then see here how I create this vector, which is a key list You know, I don't want to do that Actually, you know what I just want to do because I want to look at the whole data set So I want to get all of the columns in there for our demonstration That's what I was gonna do today because this is a test stream. I don't know if you can tell it's a test stream It's recording. Maybe I'll turn this into a video or something. Oh All right, I suppose I should really turn off notifications, right? All right, so oh, it's not responding because it's thinking about it, right? So now um, I guess I have to just entertain you while it's doing this but Trust me. I gotta get good at entertaining because sass takes a long time like sometimes like that servers pretty good for university sass, but There've been times where I've run a query that went fast and then I ran it again and it went slow and I got pissed off You know, I am. All right, so you can see that I read it in Okay, but this time I'm actually gonna make new code just for us So we're gonna say that we I'm gonna copy this Now how we're gonna make it smaller Instead of how that code did it it's we're gonna get rid of rows because I don't want to get rid of columns because I won't look at all the columns, so I'm gonna say um Just filter So I always do records in um three states Florida Minnesota and Massachusetts, right? Why because I live there Before so I'm gonna we're gonna say BRF s s underscore 8b, right? and it's subset BRF s s underscore a And it's gonna be x state. I just memorized it. That's um That's the state Phipps code and I Think this is the one in our so It's gonna be Florida's 12 So it's 27 Massachusetts 25. I think this is gonna work Let me see here Well to make sure what you can do is you can always do a number of rows This should be like big this should be like 450 something the number of rows in this first one See that yeah four and three so then the number rows in this one should be a lot less because we just took three states And if it's not that I screwed up Yeah, it's about 38,000 or else, okay, I don't know if that's small enough, right? So I'm gonna save this code here before it goes away And I'm gonna say Let's see here 120 Let's do Huh, all right, like there's too much AI in my life Let me do 118 make Because that's what I want is this wide but not very deep data set but the problem is I'm afraid That it's not gonna let me read it in because there's gonna be a limit in SAS universe So now I'm gonna write Okay, so right CSV So I'm gonna call it VR of SS 8B. This is the one But I'm gonna call it a wide file just because I Don't want to get confused because you can see I got these naming It's okay. So we're gonna save that and then we're gonna look and see if I That work Yeah, here it is So I got um So wide file came out So now what I want to do is I want to move I want to upload it here Actually, I've been uploading everything into the sex. Yeah, see these I That's a live name. I met you know, if you're used to SAS then you know that um You live by these live name things Okay, so this is where this is a wide file. All right, we're gonna just upload it and see see it's mad now, right? So I'm gonna have to go back. This is why I have our open. Can you believe I choose aren't so? I'm gonna get rid of you know, Massachusetts is a pretty small state Let's see if we just put Massachusetts in how big it is So I'm not gonna reread that It's only 6,000 so let's regenerate it and Then we'll now we'll try it Now it should be skinnier for you. Yeah, it's you show her. Okay, so now we have Whereas I thought we uploaded it. Do you see it here? I'll see it here. Yeah, here it is. Okay So now we can refer to our why why So I'm gonna show you so one of the things that's weird about if you're used to using SAS like in Like PC SAS or even on a server You're not used to not having the server right there like for example like you can see here This is my data. This is what I was using for um The R that I was doing and um Here you're on someone else's server so like where is this where is this my folders thing? So you see how I uploaded it to here, but then how do I refer to it? So and also everything is clunky about this interface. I can't pretend it's not so I'm gonna do this This is new how you make a new program. I'm never gonna get used to this interface So this is my new program Well, I figured out how to make a lib name to map to that X right and I'm gonna go copy it here So those are you who are used to SAS What you normally do is you make a lib name and you map map it to a real like a physical location like this So see these SAS data sets I would make a lib name if I was in PC SAS and just map it to that and then read it in but now I'm on the university editions. Oh my god, um So let's run this. Okay So this is another thing. That's weird. Here's your code. So this is program one Let's close this Program one and here's code login results and boy am I ever getting confused constantly? Okay? So now what we're gonna do is we're gonna import I know it's like we already imported it where did it go? Where is it? Yeah, here it looks like we already imported it But see how this one's called SAS 7b dad and this one's not we have to convert it to SAS 7b dad, right? so um Let me see here. I'm stealing code that I already made for this book Yeah, so you can convert it, but I'm lazy. So I'm gonna do what I'm gonna do is I'm gonna do proc import So let's see if I can do it automatically like I'm gonna right click on this and Do import deal. Let's just see what happens So it's gonna do it's gonna write this code for me So here's the code it made. I don't know let's copy this over here See what it does So let's say we run this Here comes our Well, I wasn't very happy Let's see input unsuccessful. What was the problem? So it's got all these problems. So proc import didn't work very well So see all this code it wrote invalid data Okay, it was line 20. So what this means is so I'm gonna go over what this is So every time you import a CSV or a TXT or something to SAS Regardless of how you actually do it what ends up happening is somehow this code has to be written this in format format So each variable oh I know what the problem is You know when I created this file, let me open it up here Then I created this file and arm are I forgot to I gotta grown it because our likes its files differently than SAS Let's see here Okay here So first of all our always creates our row names Columns, so we're gonna delete that and we're gonna delete this one Should we know we're gonna call this I? Guess we're gonna call this ID. Let's call this ID Okay, and you'll notice if our pre pens this X to the beginning of these underscores But sas likes underscores No one gets along right then the next thing is you'll see that sas likes a period Or it looks like a period when there's a missing but are They looks like NA. So what we're gonna do is control H and we're gonna make NA be nothing, right? We're gonna replace them all like that. It'll take a while. I mean I Guess I kind of use like Excel as a Data editor. Maybe I shouldn't you know people told me I'm done that way, but Okay, so this is still our CSP. I'm gonna re-import it. Yeah I'm gonna re-import it sas because I forgot about that. So I'm gonna right-click and get rid of this delete Okay, because that's why this thing was working. I mean so first I'm gonna import the the wide file Then I'm gonna try again. I think this next time. It's gonna work because I guess I'll copy this I'm kind of not don't know what I'm doing here because I'm used to doing this in PC sas. Let's see if this if it likes it better Now that I did all that Yeah, it looks happier. So you go to the log and you see see it's not complaining I mean and put X's and everything So let's just go over this a lot the code it wrote Just so you see what happens and this is basically there's actually a sas white paper on this Let me pull it up. Um See her pro It's the cutest little white paper, but it basically shows I think this is the one It shows how well you can run proc import and it's gonna spit to the log All of this information, right? So you can just copy this information out. This is the name of it proc import with a twist Okay, and this is you know, there's you live on these sas white papers and you can just copy that import code out and Place it into your code, right, which I'm not gonna do because I don't make this. I'm just being lazy But see how the proc import code first you need a set of informat code then you need a set of Format code Here's the format code and then you need the what's it called the input code Right, you can see why I like are like You just saw what I did it are it like do that So So here I think what I'm gonna say is I'm gonna this looks good enough So why would you ever copy the code that proc import writes for you in the log and Actually move it into your code and edit it Well, you do that if it screws something up because remember it's using I Think it's the first 20 rows The default is sass looks at the first so many rows It's the guessing rows. You can change guessing rows You can change it so it looks at more rows, but it looks at so many rows to guess like the file the Variable types for all of them. So it writes that code If you don't like one of its guesses then or more than one of its guesses then you can copy that code in and edit it But such a pain. I'm gonna just keep it for now. So I'm gonna save this code I'm gonna save it here. So I'm gonna call it. We'll do it under three hundred import Okay So that imports this wide file All right, and I just started saving it under I thought I saved here import wide file. Oh look. I already had a three hundred I'm obviously trying to be organized in here And I can't be because this is such a weird interface. Okay, so you want to say what I don't know What happens when you do that? Okay, so now I'm gonna do a prop contents Well, I guess that I actually want to put I want to put this Libname code see how it just keeps opening these codes here I Want to put this Libname code at the top and then I'm gonna do a prop Contents Now because I had to launder this in Um R before putting it in SAS. I couldn't like put labels and formats and stuff on like that's good We'll have to fancy though. Oh, it doesn't exist, huh? Well, where is it? It says it's there. Oh, you know the SAS one Probably isn't in there's SAS ones in work Right, I guess it's it's an oh we didn't that's the problem. So we didn't name it. Oh my god This always drives me. It's okay. We're gonna open this and we're gonna edit this So Here's the name. We're gonna change this. This is gonna be an X And we're gonna call it wine file. Okay, and Yeah, and this is already here, so we're gonna rerun this code And we're gonna put the wine file where I wanted the wine file. There it is. See that that looks like These ugly names That they always have. All right, so now when we now I'm gonna close this Now when I do this I should be able to do X one That still doesn't exist Um So here's import wine file Oh here out work. I forgot to change the out. I guess this isn't Yeah, I have to change all of these. I screwed up, of course. Okay. Now I edited the data, right? Okay, 6669 that looks right 276 variables. We're gonna die. All right data equals X Let's see if it's in there now. Yeah, there's our wide file finally See sasa's got all these things you can do wrong with it. That's what I don't like Here's our proc contents. Okay, so we were just kind of looking at this when I ran a separate one So see all this it doesn't have the labels on it because I had to do that laundry stool and oh bloodstool You know what let's put the var num All right, that um doesn't do it by alphabetical number, but it does it by variable number You'll see why that's kind of interesting So I put the id at the front. Here's a state. This is sort of the order It roughly follows the order of the questionnaire And you'll see at the end the underscore variables. See this is the variable number See these underscore variables at the end because these are their calculated variables I can't remember what company Has the contract to develop this data set. I think it's rti But they've been doing it for years and they use this convention And I don't think it's a very good one because as you can see When I move it into um r it just pre pens and acts like it's very hard to use that And also sas. I've been reading about sas because I'm writing this book. It has a lot of um Restrictions on what you can name things and you can't put really special characters in there, but you can put this underscore But you it's not like sequel, you know where you are of all these long names with underscores And you can see everything's in all cabs. So it's screaming at you That ness shangle. Oh my god So female so female So you can imagine how like sort of irritated I get with this data set, but now I um I basically got done what I wanted to do and I wanted to test this live stream. So um Let me save this So I'm gonna save this code and acts I guess So this is 304 wide file 305 Um, so this is I guess a file we'll use when I demonstrate stuff Because there's plenty of ugly variables in there that can be cleaned up um, let me see here, uh Okay, so this was the test live stream and I sort of showed you a little bit about um The uh, uh sas university edition and um, let me see if I have more live streams after this