This is joint work with Joe Saxo and this is a slightly different talk than what we saw before. So before we saw some presentations about how to compensate for missing data and what I'm more interested in is actually understanding the process that leads to the collection of the data and what are maybe aspects that influence that and that's important because only if we understand the process then we can correct for missing data and I'm looking at a specific thing and that is nurse effect and I'll explain what I mean by nurse effect and why they're important. So if you're here you're probably already convinced that biosocial data is really exciting so I'm just going to mention shortly why this is important and kind of new. So social data has some advantages so first of all typically or we like to think that it's representative so that means we can make inferences about the entire population. They're also reaching context so if you're a social scientist you appreciate that we measure things like value, attitudes and we know those are important for how people behave so we have very rich context including for example I don't know what their parents did when they were children which might influence health outcomes and lots of information from the social world and we also have unobservables and again this are the kind of social science unobservables like attitudes and values that we can't really measure with anything else and surveys are really good at measuring that and the biological part first of all yeah we like to believe their objective yeah so that's an advantage that is often cited for biological data versus like self-reports for example they're also rich in detail so for example we have lots of information about stress we have lots of indicators that tell us in very detail different stress levels and that could be very useful for looking at health outcomes and we have other types of unobservables like genetic data that could be used in different ways so there's a sweet spot there in between where we have a combination of the two so I think that's why there's such a big push in investing in collecting biological data in representative surveys so we have surveys like understand society English launch soon study of aging the cohort studies health and retirement study there's lots of studies that are surveys but also start to collect biological data and the ideal is to bring together the advantages of each so and like I said what's exciting is that we can answer new questions that we have never been able to do before so for example if you have a launch soon study you could see how people change in time you could understand the employment status of their parents when they were children and then you could also look at how those influence by their biology their stress hormones for example and we can also do exciting things like life course and in which we use both social and biological measures so for example Elsa has multiple waves of biological data collection so we could look at changing time for for example stress indicators so this is really exciting and again I don't think we were able to answer this kind of questions with any other type of data and with new data always comes kind of new difficulties so some of the new things we have to figure out is how to collect this new data so surveys traditionally have been done very differently we have interviewers going to the homes or maybe by telephone collecting data but now we need to collect things like blood pressure or things like actually getting blood so the question is how do you do that in a representative sample and there are different models to do that so you could ask people to go to a clinic and collect data you could send interviewers or you could send nurses so there are different ways to do the same thing and we need to figure out what's the best way to do that and secondly how to correctly analyze it so we could assume that if it's in one database everything is measured in the same way but it's not really true so as some of my colleagues already mentioned there are different stages of missing data that happened when you collect biological data and that's different than what happens with the survey both because the person that collects them is different but also what we ask people to do is different so we might have different mechanisms of missing which are really important so what I'm going to talk about in this short talk is about the new actor in data collection and I say new actor because I'm a survey methodology so I talk from the perspective of people that collect data until now we didn't have to deal with nurses okay so this is some well or you could but in a private I don't know you need to go to the hospital we didn't really need to train them and work with them and convince them to do a good job so this is really new so I'm going to talk about how this new actor actually influences data collection so they have to do the nurses have to do a couple of things so first they have to convince a participant to take part so usually there's a main survey and then a few months later the nurse goes and collects biological data and there are different models so sometimes they would be contacted by telephone and then the nurse just goes there and does her job but sometimes she actually has to convince people to participate and again this is very new for them so most nurses sit in the office and people are desperate to come to them and get their help it's not their job usually to go to people's home and convince them to give blood that's like a very different thing than what they were initially trained to do so they again like for survey methodologies they need to train them to do this new task that they never had to do before after they convince people to participate typically what happens is they collect some biomarkers so for example they collect a lung capacity blood pressure height weight and things like that and then comes the most difficult part where they collect blood so the first step is actually to get consent for blood so there's this big form that they have to sign in which they say okay it's it's okay to get the blood and it's okay to you to keep it for a long time and do whatever you want with it yeah so they're actually different things they have to consent to and after that there's another stage where they actually have to collect the blood so even if they consented they might not give the blood because for example they might be obese or it might be hard to find the vein and collect the blood so in all of these three stages the nurses are very important and what I'm interested in is if the nurses actually influence the non-response pattern so do are some nurses better at convincing people to participate are some nurses better at receiving consent and if that's true then they are actually influencing the non-response patterns and we need to take them in that into account when we correct for it later and it also gives us insight in if we need to change for example the training of our nurses and to give you an example how the nurses are kind of new and maybe they're not used to doing surveys so recently me and Joe were trying to look at para data so this is data that is collected in the process of a survey and looking at the para data of nurses that I don't think anybody looked at before and basically the para the quality of the para data was horrible okay so it wasn't useful so most of it was missing there were yeah there were really strange things happening and that's probably the reason is because they're not used to doing that and they don't think it's important and that's very different from my interviewer that is trained to do this okay so that's one thing so they have less interviewer training and they have less experience and also the task is very intrusive although I know they're economists that would say that actually giving income is more intrusive than giving blood but still giving blood is quite intrusive yeah so it's a very different task than the normal tasks that we have we ask interviewers to do so yeah these are the reasons why I think the nurses are important and again this is an empirical question we don't I don't know anybody to have looked at it before so the question is do they matter if they don't matter that it's fine we can move on if they matter we need to do something about it so this is an example of kind of the process of data collection so this is from understanding society so you have wave one in this case we have some respondents in green and then some non-respondents in red then we have wave two and again we have some more non-respondents and then in wave two a sub-sample was selected for the nurse visit and then we have this this free stages so we have the nurse visit we have the consent to blood and then we have the actual blood collection and we see that with each stage we are missing some people and in all of those stages the nurses are involved so my question is do they differentially influence these stages or not so that's my research question so how to look at this so first of all I'm going to separate the free stages the nurse visit blood consent and blood collection and the reason I do this is because the mechanisms for missing might be different so for example if you for the nurse visit and convincing somebody to participate you might have no contact so it might be related to if people are working or not or the kind of jobs they have on the other hand if you have the nurse visit you need to get consent and that again is kind of a different process because it might be related if people trust the state or they try they trust the nurse or the agency so it might be related to other things than the mechanisms that live to missing for the nurse visit and finally the the blood collection also might have different mechanisms so for example it's it might be because once they collected they can't really get the data because they're obese or maybe because just the nurse is not very good at collecting such such data okay so we have free stages and then statistically to do this we need to do a couple of things so first of all nurses are not randomly distributed around the country so for example maybe better nurses are around London and the nurses that are in a different region are less good so in order not to have a bias in that we need to separate kind of area effect and nurse effect and one way to do this ideally would be to randomize nurses all over the country but that's very expensive and that will never happen so one statistical way to do it is to try to separate them using a multi-level model so we use a cross classified multi-level model in which you we estimate for areas which are LSOAs and then nurses and then we also correct control for characteristics of the respondents and some characteristics of the nurses so this is statistically how we we go about it so the data I'm going to use come from understand society so first we use understand society wave 2 we have around 25,000 people that were eligible to have the nurse visit and out of those around 10,000 gave blood so our question is what happened to this 15,000 and if the nurses influence the process of non-response then we look at wave 3 of understand society where they have a new wave of the British household panel so this is a older version of understand society that started in 92 if I'm not mistaken so for there there we have 9,000 people eligible and around 3,000 gave blood so these are the two databases that we're looking at data collection was done both by not send with kind of the same nurses so in principle we might expect differences because we have different people so we have in BHPS people that are older and also people that are very compliant they've been in the survey for 20 waves so they're really nice respondents while in understand society we don't have that we have more new respondents that might drop off soon okay so first what I do is I have the free stages here so nurse visit with blue blood consent with red and then actually giving blood with green and then I have here on the left some characteristics of the respondent so this is for understanding society so for example and the scale here is odd ratios so if it's bigger than one then there are higher chances of participating for example for females they have higher chances of participating in the nurse visit compared to men but they have lower chances to participate in the to actually give blood compared to men and this is kind of interesting because it shows that the mechanisms for missing might be different yeah and this is one of the reasons why we might want to separate them then we have some things that we expect so we expect older people to tend to participate more compared to younger people so this is something that we find often we find that for example having a partner is important for having a nurse visit but maybe not important for the other two stages and so on so there are different kind of patterns we find that if you're in London it's harder to do the nurse visit as you would expect and also if you have actually a long illness you're more likely to participate so these are the characteristics so we could use information like this in multiple imputation or waiting to compensate for missing data and again I think one insight is that we have this missing different patterns and we should take this into account maybe when we compensate for missing data this is the same thing for BHPS most of the patterns are quite similar so I won't go into details so the more interesting part is about how the nurses influence data quality and there are two parts to this one is the amount of variation so how much of the variation is explained by the nurse in the non-response and the second part is is systematic so for example are more experienced nurses better at this than non-experienced nurses and that's also interesting because we can use that both in the correction on also in kind of designing data so we could offer more training for those nurses that have less experience so what do we find so again here on the bottom we have the three different stages and then we decompose the variation of non-response into three parts so this is the nurse part the area part and then unexplained okay so what we're interested in is this red part so the assumption would be that the nurses have no influence if that's true this should be zero so they would explain nothing of the variation of non-response for each stage so we see that that's not really true so we see that they influence non-response for the nurse visit they also do that for consent and the same for giving blood and for understand sight we see that actually the biggest effect is for getting the blood which kind of makes sense because that's where their skills are important so if you have somebody who let's say is obese then the skills of the nurses are really important in actually collecting the data for BHP is the effect is kind of similar at all the stages so we see that around 10% of the variation in non-response comes from the nurse okay so one way to think about it is you as a cluster effect in in complex sample design so that's also one way in which you could correct for this or you could use something like multi-level in your analysis to correct for nurse effects the next step was to look at the nurse nurse characteristics so unfortunately we don't have lots of nurse characteristics we have gender which is not very useful because 98% are female and then we have three other actually I'll go to that in one moment first I want to show you these graphs so these are kind of predicted probabilities from the multi-level model and the way to read them is each blue point is a nurse and then they have a probability of getting interviews and then a confidence interval so we expected all of them to be here but actually what we find is that some are better than expected and some are less good than expected so this is understanding bhps and then this is for the first stage and we can get the same for consent to blood and the same for having if they actually collect the blood or not and this is actually quite interesting because we could use this information in different ways so first of all when we design or we collect data we could actually identify for example this group of nurses and offer more training or understand why they're underperforming also we could look at why some nurses are better than the others and take that into account and then we can also include these indicators in a different model so if we want to correct for non-response we could make an indicator saying this is a better nurse than average or this is a worse nurse than average and put that in our models for non-response and I think this is kind of interesting information we can just get from after data collection okay so next to the nurse characteristics so here again I have just two stages the blood consent and actually getting the blood for understanding bhps so female not a lot is happening here experience again nothing significant and the only significant finding is for white British so it's actually if the nurses white British they have lower chances of collecting the blood in understand society and bhps but that's the only significant effect we we found with nurse characteristics okay so a few conclusions first we found low to medium effects of nurses so around like I said around 10% of ICC and again that might influence standard error so I would argue that well as a survey methodologist we should take that into account at least as sensitivity and again we should do that because we have that in the data so when before publishing we you could just control for that and see if you have different results we saw that the biggest impact that listen understanding site is actually on the blood collection so again we might think why that is the case and maybe offer more training especially for cases that might be difficult to improve this in the future and then the nurse characteristics explain only a small part of the variation so we explain only between four and ten percent of the nurse variation so clearly there are other things happening that we don't know about and I think that would be interesting to I don't know do a survey of nurses or get more information to understand what really is causing these differences and again I think that would be useful both for correction and also for improving the training or improving data collection so okay what does this mean so should we stop collecting blood from surveys or what what what does it mean so that's what would be no so nurses are clearly doing an important job like I said the data is really valuable we can do new things but also we can probably improve the way they do their job so either during data collection or also trying to train our users to use that information to correct for missing data and convince people like I don't know Georgia or or just to include it in their in their models for non-response because the data is there it's it's basically free and yeah we should we should use it so I think that was it for me thank you so much


What is up everybody welcome back to the channel you guys in today's video. I'm gonna show you two basic steps to super super powerful effective Just strategies steps just basic Disciplines that you want to get in the habit of doing right when you set up a Facebook ad Okay, and this is basic, but this is so freaking important and this is what it's all about. So The moment you the moment. Let me go to share the screen The moment you you put up an ad right there's two ways to really run a Facebook ad Instagram ad same damn thing, right? You can either post it on the business page first and then come over here to the ads manager Hit the create button and run that ad right use existing post run that ad post it on the business page first And then come back here and run that ad right? That's one way to do it The second way to do it is to is to is to is to run it run it Behind the scenes and what most call that is a dark post ad a dark post ad is when you don't post it on the business page first And you just simply have the image in your download folder video in your download folder And you just straight come over here hit the green button go straight through the through the through the ad setup And then pull that asset pull that image video from your computer pull it from your download folder and run it that way Right, that's behind the scenes. It's again. It's what they call a dark post ad The reason why I don't do it that way is because you're spending money on it, right? You're spending money on the ad you're spending money on the post The moment that ad shuts off the the post is offline and nowhere to be found ever ever ever again Right and I'm like the way I look at it I'm like dude if I spend money on it I might as well let the post live forever right even if it bombed even if it wasn't a freaking great ad So be it how many times you guys post all over the damn place and none of it gets engagement either so it's like Who cares especially so if I if I if I put money in it It's like dude, I might as well let it live on the damn page So that's why I post it on the page first and then I come back here and run the ad Okay, so that's what just happened right now. The post was was put up and all I'm doing is some basic Facebook cleanup for one of my friends Shout out to shout out to to so beard shout out to just crushing it crushing it building a global brand So I'm just doing some cleanup in the Facebook ad manager side of it all and in doing some basic setups, right? So the post was put on the page first then what I did is I came over here and I ran an ad right? I set up an ad for them. It's just a simple engagement ad the whole purpose of this the whole objective The whole strategy is to simply create engagement right target a local area create a buzz create a freaking Create some some some people talking right having comments below people sharing the post whatever right Engagement and then and then creating a custom audience around those Engagers so you can then retarget in the future. That's what this is all about right engagement ads So so if you're running engagement ads if you're running video view ads Brand awareness reach right as you come in here and click on this green button Let me go ahead and And you just choose whichever objective right the whole whole whole thing is is is Again, whether it's reach brand awareness traffic engagement video views even lead generation messages Conversions no matter what the hell it is right two things you want to do right away So in this case we went with engagement. I just got done setting it up I just got done setting it up. It's scheduled scheduled to go live tomorrow and And that's what I thought of of you guys. I'm like dude. Let me just show you Let me just record a damn video real quick Let me show you two important things that I was about to do right now anyways And that's the thing about my channel. So if you guys are new to my channel, my name is David I'm out here in San Diego building been building an agency getting clients on social media marketing services and Facebook ad Coaching services teaching people Facebook ads the basics of Facebook ads And and and and I've been doing that full-time all day since 2017, right? So so hundreds of clients spoke to thousands of people on this topic And in some like dude, these are two basic things. I'm gonna do real quick anyways Let me just show show show my YouTube fam So boom that ad was just set real quick, right? So again, if you guys are new subscribe man, if you're into this type of stuff subscribe Because all I do is I document what I'm doing. I'm documenting. I'm For my YouTube fam. I'm documenting day in the life whether I'm building a landing page But whether I'm putting together some email Automations whether I'm running some some Facebook ads whether I'm cleaning up a Facebook ad account for a client Whatever, right? I'm trying to document that so if you're into that type of stuff definitely subscribe so Boom went up Scheduled to go live tomorrow two things that you want to do right away. Okay, right away right away Right when you set that hit the three lines to the left and the first thing you want to do is you want to go to You want to go to audiences? You want to go to audiences and there's two audiences, so it's not just two things to do It's actually two audiences to create. That's what you're really doing. That's what I two audiences to create I guess that should be the name of the video here two audiences to create the moment you set a Facebook ad Okay, two audiences to create the moment you set a Facebook ad so in this case I'm gonna I'm gonna come over to audiences. I'm gonna make sure and I'm in the right account, right? There's the right account right there in the top right 360 alloys I notice that there's one audience right here So what I want to do is I want to create based on this post based on this ad, right? It's a video It's a video. It's a 30-second video. Okay, so so so again in this case two things I want to do two audiences I want to make sure are created before it goes live, right and here here here are the two audiences So we click the blue button we go to custom audiences and what I want to do There's actually three audiences three audiences. That's the first one web visits. That's the first one That's the first audience, but that's already a given your pixel should be on that that landing page or whatever pages throughout your website should be all Set up as custom audiences each link Act to cart link custom audience. Thank you page link custom audience landing page link custom audience every single page within a website should be set up as a custom audience In my professional opinion. So this one's based on just the web visits. That's a given that should be set up for sure But the two other audiences that you want to make sure are set up right away. The moment you go and run an ad is is in this case because I'm going engagement What I want to do is I want to I want to click on Facebook hit next And then I want to go with I want to make sure I'm in the right page. So it's going to be this one down here. So I want to make sure I'm in the right page And this one's going to be engagement. I'm going to go 90. I'm going to go 90. This is going to be people who engage. Look, you have all these different options. You have all these different options. People who currently like or follow your page. Boom. You can create an audience and only target them on Facebook. How powerful is that, dude. Right here. Everyone who engaged with your page. Anyone who visited simply visited simply landed on the Facebook business page and boom they retract. Now all of a sudden you you have a month in an audience and you can run an ad to them right away. Right. That's super powerful. People who engaged with any post or ad. That's what we want right in this case with this specific audience. I want this one. I want people who engaged With any post or ad right and I'm going to have that collected for 90 days. So if if if you if you went to if you if you engaged with the post or ad 97 days ago, you wouldn't be in this audience. Right. It's only people that have engaged within the past 90 days. So that's going to start to count right account be accounted for Is is a 90 day I can I can get the max you can go is 180 right 180 but again based on certain audiences are dependent on certain audiences that you're building You may want to you may want to reconsider that number. Right. Like, for example, if you watched a video of mine. 180 days ago and that was the only video you've ever watched and you only watched a few seconds of it. Right. You only watched a few seconds of it. You're not going to remember me like 180 days ago like you're probably not going to remember me if you only watched a few seconds of something.  You're just not you're not you're not so depending on the audience. Now if this was leads if this was an audience that I was creating. Around my leads. How do you create that you take your thank you page. So if I go to your page. I enter my name and email, no matter what it is for a calendar scheduling for for a lead often whatever your real estate agent you're you're selling something you're on Shopify whatever if I buy your stuff. Or if I opt in to download your stuff, whatever maybe I should be I should be taken to a second page, which is a confirmation page. That's the most that's one of the most important audiences. Ever on the entire planet of the internet because that's how you track your leads. That's how you segment your leads. That's how you figure out your cost per lead. Is is based on the traffic based on the visits of a specific link right an audience. That's an audience, people that landed on thank you page. Thank you for buying or thank you for scheduling Our appointment is confirmed right these basic confirmation pages are your money pages but but but you know so on the other hand what you want to be doing is you want to be Segmenting right properly segmenting. This would be an audience, for example, around if that was the audience leads that would be an audience that I'd be that I'd be building To start excluding those people from future ads right if I'm running the same ads, especially throughout the month if I'm trying to give people to opt in or if I'm trying to give people to my webinar. Or if I'm trying to give people to buy a specific product and I'm running ads throughout the whole entire month. There's going to be people that opt in there's going to be people that buy those people again are your audiences, those people are people that you would exclude I would max out an audience like that, for example, 180 If you bought or if you opted in. Yeah, dude, you're whenever you're going to be in that audience Max. If it was a video if it was a video which in this case again people who engaged with post or add The max I'm going to go is 90 days 90 days 90 days is the max I'm going to go with that and in this one is going to be called the audience name. Is actually going to be called. Six years carrying out repairs, but it's actually any post people engage with any post or ad right so so that's what i'm going to name it that's actually that's actually what i'm going to name because it's not on a specific ad it's on any people engaged with any. post or ad right so it's not just this one right even though it's going to be an ad and and and that's cool so so what i'm going to do in this case is i'm going to go. Engaged engaged engaged with any post or ad exactly what that is that's exactly what that is i'm going to go 90 days and i'm going to create that audience so that audience is powerful man, especially if i'm putting money behind the post right so.  There in that audience as well right, but that's going to be random that's going to be just your organic. random engagement if you're actually putting money behind it okay cool that ad that ad that ad that's what I that that's what I want to accumulate right is an audience of those who have engaged with with an ad. Now that's number one right that that's number one audience actually yeah that's that that's what this is all about the two things that you want to do right away that that's one. The second, because it's a video ad because it's a video post I also want an audience around those who watch a certain percentage of the video the video is 30 seconds long. Right, the video is 30 seconds long right, so what we want to do is we want to come over here, we want to go create audience where did it go create audience custom audience.  Okay, custom audience hit next go video and then all we're going to do is simply go because it's a shorter video right 30 seconds 30 seconds. You want to create an audience of those who watch at least at least at least half of it man at least 15 seconds at least 10 seconds whatever three seconds whatever but again dude it's an audience right i'm trying to i'm trying to i'm trying to create a warm audience. So 15 seconds i'm going to go with 15 seconds on this one and you can you can play around and you can go with as many as you want, dude you can I could freaking choose I can create as many of these these as I want. Right, but but I don't want to overwhelm myself so I just kind of go with one simple one 15 seconds in this case choose video. We're going to make sure we're in the right page go down to the right page and then you'll see it right here right so we have established it's that one right there. Three second views only two of them so boom I just set that ad live. And that that view can will obviously start to grow this right here again i'm going 90 i'm going 90 i'm naming it six years carrying out repairs video actually. Let's go video we're going to go video and then in parentheses in parentheses we're going to go 15 seconds. Okay, so there goes the audience so those are the two things you guys that the moment that ad goes up right in this case we're going engagement right to create the audience. And then right away boom I want to come come over here hit the three lines go to audiences and create those to engage with any post or ad but we obviously want the ad part right engaged with any ad. That's important, and then and then make sure that the landing page or the web page. That's an obvious make sure make sure you have have that audience, but then also the second one today was making sure that you set up that video that video audience start and start segmenting start categorizing all your video viewers and then start again retargeting and show them show them more ads. And as you as you continue to build out these audiences as you continue to stay consistent. You start to run conversion ads and that's really where you want to be as conversion. So if you're in the business of making cells, capturing leads or getting people to schedule appointments and you're running traffic. You want to be running conversions. Okay, so, but this is just how you get it going. This is how you start spending some money is how you start creating some audiences. And then this is how you really bring your brand out man so get get the audience to got the audience to engage and build a relationship from there. Alright guys over now I'll see you in the next video.


this is my third tutorial and today will be solving you know some randomly selected problems. Let me start with this problem, problem six because I have solved five problems before that in the general linear regression situation with the beta not term in the model the correlation between the vector e and y is one minus r square square root of this. This is sort of you know theoretical problem but this has some implication we will come to that point later on. So, the first part says that you know you find the correlation between the vector e. So, this e is the residual vector and y is observed response and we have to find the correlation between e and y and we have to prove that that is square root of one minus r square where r square is the coefficient of multiple determination. So, we know that this r square is equal to s s regression by s s total. So, this r square parameter it sort of measure the proportion of variability in y that is explained by the model. So, let me solve the first part a the correlation between e and y. So, the correlation between correlation between e and y that is nothing but summation e i minus e bar into y i minus y bar by summation e i minus e bar square into y i minus y bar square and the square root of whole thing. So, we have to prove that this is equal to one minus r square where r square is s s regression by s s total not so easy. So, we can start with this numerator e i minus e bar y i minus y bar i is from one to n. So, can I write this one as just e i into y i minus y bar because of the fact that e bar is equal to 0 if beta naught is in the model because if beta naught is in the model then while differentiating the least square function s with respect to beta naught we get summation e i equal to 0 and from there it is e bar is equal to 0. So, we can write this is equal to e i into y i minus y bar i is from one to n and this can be written again this can be written as e i y i i is from one to n because you know this summation e i is equal to 0. So, in matrix notation this can be in vector notation it can this can be written as e prime y or y prime e. Anyway what is e prime y can I write this as e prime e it is not trivial. So, we need to check this part whether this is equal to e prime e. So, let me start with e prime e and then I will prove that e prime e is equal to e prime y. So, before that let me recall the multiple linear regression model y equal to x beta plus epsilon and here we know that the parameter beta is estimated by beta hat which is equal to x prime x inverse x prime y and then the fitted model is y hat is equal to x beta hat right this is the fitted model and we know that beta hat is equal to x prime x inverse x prime y. So, I can write this one as x and then I plug the value of beta hat here.  We this is called hat matrix you know we know about this h matrix. So, this is called hat matrix because of the fact that. So, finally, what we got is that we. So, y hat is equal to h y because this hat matrix transform y to y hat that is why it is called hat matrix. So, where h is equal to x x prime x inverse x prime. So, y hat is equal to h y. Now what is e then e is equal to the observed value minus the estimated value. So, just now we have proved that y hat is equal to h y right. So, this one is equal to i minus h y. So, i is the identity matrix. So, now what we want is that I want to prove this e prime e is equal to e prime y that is what I want. Now I have a formula for e in terms of hat matrix. So, let me start now e prime e I can write e prime e is now in terms of hat matrix that is y prime i minus h prime i minus h y and it is known that you know this hat matrix is idempotent matrix. That means h square is equal to h and then i minus h is also idempotent. So, what I can write is that this is y prime this can be replaced by only i minus h y. Now i minus h y is equal to e. So, this is equal to y prime e. So, we have proved that e prime e equal to y prime e. So, what we have proved is that the numerator is equal to e prime e which is equal to e prime e is nothing but summation e i square which is nothing but s s residual. So, we have proved that the numerator is s s residual and what is this?  Let me write down once more here. So, the correlation between we want to find the correlation between e and y which is equal to summation e i minus e bar y i minus y bar by square root of summation e i minus e bar square y i minus y bar square. And we know that this one is equal to we proved that this one is equal to e prime e the numerator is e prime e and then since e bar is equal to 0 this one is nothing but summation e i square. So, this is again e prime e and this one is nothing but s s total square root of this.  So, we are almost done and then this can be written as 1 minus s s regression by s s t. So, this one is nothing but 1 minus this one is r square so 1 minus r square. So, we proved that the correlation between e and y is square root of 1 minus r square. So, here is the problem. So, we have solved the part 1 of this problem and what is the implication of this? The implication of this result is that it is a mistake to attempt to find the defective regressions by a plot of residual e i against the observation y i as this always shows a slope. So, if you can recall you know once we have a fitted model say y hat is equal to x beta hat then what we do is that we compute the residuals and in a topic called model adequacy checking we talked about several residual plots and that residual plots is sort of to check whether the model assumptions are correct or also to check the goodness of the fit. So, what we do in the residual plot is that we plot e i residual against y i hat not y i. So, this is the reason why we plot the residual against y i hat not against y because there is a correlation between e i and y i. There is a correlation between e and y and the correlation we just proved that it is 1 minus r square square root of that. So, that is why we do not go for plotting e i against y i because there is always a theoretical slope between them since because of this correlation now. So, the second part says that so that this slope is 1 minus r square what is the meaning of this one is that if you fit a linear relationship between e and y the slope is going to be 1 minus r square in that linear fit. So, now let me fit a relation between e and y suppose the relation is a straight line relation.  So, what have to do is that I have to prove that this b is equal to 1 minus r square the slope is 1 minus r square this is part b. So, we know what is this b we know that b is equal to e prime y by y prime y because you know when we fit like y equal to e prime beta naught plus beta 1 x we know that beta 1 is nothing but s x y by s x x. So, similar to that so x y is nothing but x prime y and then x prime x. So, this has been followed from here now e prime y is just now we proved that e prime y can be written as e prime e. So, by y prime y.    So, the slope the b we have proved that this is 1 minus r square and the third part of this question is that. So, further that the correlation between e and y hat is equal to 0. See in the residual plot we plot e against y i y hat because their correlation is 0. We have to prove that now maybe I have proved this in the during the class also anyway. So, the correlation between part c between e and y hat is 0. So, the correlation between part c between e hat and this one is equal to. So, first we will start with summation e i minus e bar into y i hat minus y hat bar. Well now e prime e bar is equal to 0. So, this is the correlation this can be written as e prime y hat and we know that y hat is equal to h y and also we know that y hat is equal to h y and also we know that e is equal to 1 minus h sorry i minus h y. Just now we proved these two things. Now if I plug these two values here what I will get is that my e prime y hat is equal to 0. So, this is the correlation between part c between e prime. So, y prime i minus h and y hat that is h y. So, this is equal to y prime h minus h square into y. Now see this h is a Hadamard matrix. So, h square sorry I do not know Hadamard matrix. So, h square is equal to h. So, that is why this is equal to 0. So, the correlation you can see the co-variance is equal to 0. So, the correlation is the numerator this is the numerator of this correlation expression. So, the correlation between e y hat is equal to 0 because of this fact. So, the correlation between e y hat is equal to 0. So, we are done with the first problem. Let me prove one more problem which is again no theoretical call it problem 7. This problem says that you have to prove the coefficient of determination is equal to the square of the correlation between y and y hat. So, what you have to prove here is that you have to prove that the correlation between y and y hat and the square of this one is equal to r square. So, this is equal to r square is again the coefficient of determination which is equal to s s regression by s s total. So, it is nice to prove this one. Let me write down that what is r this correlation I will use the notation r y y hat. This is the correlation between y and y hat. So, this hat which is equal to summation y i minus y bar into y i hat minus y hat bar you can write but this two are same by summation y i minus y bar square summation y i hat minus y i bar. Yes I hope you understand that y bar is equal to y hat bar. This is the observed mean of the observed value and this is the mean of the estimated value. You know that e i is equal to summation e i is equal to 0 for a model with intercept and then e i is nothing but y i minus y i hat. So, this says that y i minus y i hat. Summation y i is equal to some y i hat and then of course y bar is equal to y hat bar anyway. So, this square and the square root of this. Now, this can be this y i can be written as we know that this y i is equal to y i hat plus the residual e i. So, if I put that expression here what I will get is that I will get y i hat minus y bar into y i hat minus y bar because this is nothing but y bar only plus I have extra term here because of this plus e i. So, plus y i hat minus y bar into e i and the denominator is the same. Let me write down that this is y i minus y bar square sum y i minus y bar square minus y i hat minus y bar square. Now, what about this one is this 0? Yes, just now we have proved that the correlation between e and y is equal to 0. So, this is the covariance between e and y hat. Just now we have proved that in the previous problem we have proved that the correlation between e and y hat is 0. That means the covariance between e and y hat is equal to 0. So, this term is going to be equal to 0. So, what we are left with is that then the correlation this r y y hat is equal to some y i hat minus y bar square by this. So, I can write this one as summation y i minus y bar square and the square root of the whole thing. Is it clear? Because this one is just I am writing square and then you can cancel out. So, r y y hat is equal to this one and this one is equal to the numerator is s s regression and the denominator is s s total. So, what I got is that this is equal to r square. So, that is what you have to prove that the correlation between the square of the correlation between y hat. So, what you got is that r y y hat square is equal to r square. This is what we wanted to prove. So, this is what we wanted to prove. So, next we will consider a practical problem and this problem is involving orthogonal polynomial. I mean polynomial fitting using orthogonal polynomial. So, here in this problem we will sort of explain how to decide about the degree of decide about the order of the polynomial. So, here the problem is that new born baby was wetted weekly and 20 such weights are shown below. So, this is the first week the baby has weight 141 ounce and similarly for 20 weeks the data are given and if you draw scatter plot for this one I am sure that you are going to have a non-linear pattern may be. So, you fit to the data using orthogonal polynomials a polynomial model of degree justified by the accuracy of the figures. So, the degree is not given. So, you have to decide about the degree of the polynomial you are going to fit here. So, we will sort of follow the pattern of that we talked about how to decide about the degree while talking about orthogonal polynomial fitting or polynomial fitting. So, you start with the linear model and then next you fit a polynomial of order 2 and then you see the significance of beta 2 that is the coefficient of x square. If beta 2 is significant then only you go for third order polynomial, but if you see the beta 2 is not significant then first order polynomial first order model is enough, but if beta 2 is significant then you go for third order polynomial again you have to test the significance of beta 3. If beta 3 is significant then you go for fourth degree polynomial if it is not significant you stop at second degree polynomial something like that. So, here this problem sort of you know give idea about how to decide about the order of the polynomial. So, let me recall little bit what is polynomial model. So, we wish to fit the model say y equal to beta naught plus beta 1 x plus beta 2 x square plus beta k x to the power of k plus epsilon and what we learnt there is that you know instead of fitting this model there are several advantages if we go for polynomial fitting using orthogonal polynomial.  So, p k x is k th order orthogonal polynomial and of course, there are all orthogonal polynomials well. So, we know how to fit this model we know what are these orthogonal polynomial if you know I please refer my lecture on polynomial fittings for to know more about you know this orthogonal polynomials. So, what we know is that we know that alpha naught hat is equal to y bar we know that alpha j hat is equal to p j x i into y i by p j x i into y i by p j x i into y i by p j x i square. So, what we want to say here is that by using all this formula.  So, this is the j th order orthogonal polynomial. So, you can compute beta naught and beta j hat for j equal to 1 to k. Now, let me just write down that also you know that the s s regression due to alpha 1 that is the contribution of the first order term in the polynomial that is equal to alpha 1 hat sum over y i p 1 x i. So, and similarly s s regression due to alpha 2 is equal to alpha 2 hat sum over i y i p 2 x i for i equal to 1 to n. And similarly s s regression alpha 3 equal to alpha 3 hat sum i is from 1 to n y i p 3 x i. Why I am talking about all this s s regression due to alpha 1 alpha 2 alpha 3 is that what you know I feel is that you first given given the problem you know you have x i y i values. So, these are the x i y i values this is your x i this is y i. So, given this thing you first compute what is the total variability in the response variable. So, the response variable here is y. So, weight and this is x you compute s s total first to check the variability in y about the mean that is y i minus y bar square. And once you know the total variability here it is you can check that this is 26000 018. So, this is the total variability and I want my model to explain this variability. Now, what I will do is that I will check the s s regression due to alpha 1.   And similarly s s regression due to alpha 3 will give the linear term. So, this is amount of variability that is explained by the cubic term.  If you see that alpha 1 and alpha 2 together they have almost explained major part of the variability in y then you can stop at the quadratic fit, but if you see that still there are significant part which has not been explained by the quadratic fit then you can go for cubic term. So, this is my s s total and I want my model to explain this variability. So, what I will do is that I will compute see I know I am not going into detail of computing all these things. So, you can compute alpha 1 hat you can check that this is equal to you can have the computations you can check that this s s regression is equal to due to alpha 1 is very large this is 25,438.75 and s s regression due to alpha 2 is 489,00 and s s regression due to alpha 3 is 1.438.75 and s s regression 1.5 and let me repeat that s s total that is y i minus y bar the variability in the response variable about mean is equal to 26,018. So, you can see this is the total variability and the first order term or the linear term has already been explained has already been explained major part of this total variability. And alpha 2 is also significant this is 489 and what you can do is that you know see you can now make a maneuver table let me do that.  So, regression due to alpha 1 regression due to alpha 2 regression due to alpha 3 and say residual and then total. So, total s s we computed that this is 26000 018 and s s regression is due to alpha 1 is 25000 438.75 s s regression due to alpha 2 is 489 and s s regression due to alpha 3 is 1.15 and you can check that the s s residual is just 89.30 and the degree of freedom for this one is one this one is one this one is one and total degree of freedom is 19 because there are 20 observations and then the residual degree of freedom is 16. So, you can compute the m s value m s residual is 5.58 and this value will be will remain same 25000 438.75 489.001.15 well now see of course then the f value f value you can check that this by this that is going to be 4558.92 and f value for alpha 2 is this by this that is 87.63 and the f value for alpha 3 is 0.21 and this all this f follows has degree of freedom 116 and now you check the tabulated value of 0.05116 that is equal to 4.49. So, you can see that this one is much larger than the tabulated value this one is also much larger than the tabulated value, but this one is smaller than 4.49 the meaning of this one is that alpha 1 is significant alpha 2 is also significant because the f value observed f value is greater than the tabulated f value and this table says that alpha 3 is not significant that means you can go for a quadratic fit. So, the final fit in terms of x is 136.227 plus 2.68 x plus 0.167 x square that you can check, but what I want to say is that this is my total variability and I want to explain I want to I want my model to explain this variability. Now, you can see that this linear term explain huge part of the total variability the quadratic term explain this much of total variability and the cubic term is not significant right and now we can see that you know out of 26000 of the total variability major part has been already been explained by the model and the remaining part is 89.30. So, I can go for a quadratic fit, but here just I want to say suppose your cubic term is not significant but still cubic term is not significant, but this residual is still reasonably high then you can go for alpha 4 see alpha 3 might not be significant, but alpha 4 could be significant I mean I fit so. So, in that case you can go for a model with linear term quadratic term and the fourth degree, but not the third degree. So, it depends on how small the residual is if the residual is reasonably small then you do not need to go for the higher order polynomial, but somehow I feel that you know even if the third degree even if the cubic term is not significant it might happen that the fourth degree term is significant, but you have to go for the fourth degree polynomial only if the residual part is large otherwise you know just forget about that you go for the quadratic fit. So, this is the problem we talked about from the polynomial regression and next let me talk about one more problem this is I do not know what is the number this might be 8 well. So, this problem says that if you are asked to fit a straight line to the data this given data what would you say about it I mean it is sort of difficult exactly know what the question is asking for looking for. So, you are given 1, 2, 3, 4, 5 data points and here is the scatter plot for the given data. So, this is my x axis this is my y axis and here this is my y axis do you have anything to say because see here you can see that this particular point that is 6, 4.5 this particular point is not in the usual trend of the data. So, that means some at some point of time you know I talked about influential observation and leverage point. So, this point this 6, 4.5 it seems to be a influential point because this one is not in the general trend of the other data. So, 6, 4.5 is an influential observation right and see if you with this point I mean without this point you can you can think of fitting if you if you fit a model to the remaining data you will get a fit with negative slope.  So, that is the problem with the influential observation. So, without the point this 6 this is my 6, 4.5. So, without this point the fitted model has negative slope and with this point you will get a negative the fitted model has a positive slope. So, this clearly says that the point 6, 4.5 is an influential observation. So, the recommendation here is that you know if there there exist influential observation very few influential observation. If you can identify if you can identify an influential observation in the given data may be you can ignore them if they are not large in number you can ignore them and fit a model for the remaining data. And what could have been better here is that you know if. So, if you see here you know you have data up to 3 and then the next one is 6. So, the next one is 6 some observations between x equal to 3 and x equal to 6 would be useful here. So, this is also you know you can comment in that way. So, we solved you know some problems in this tutorial and again in the next tutorial we will solve some randomly selected problems. Now, we need to stop thank you.


Pathological gaming, PG, is a growing concern among children around the world. This study assessed the prevalence of PG among elementary school students in Japan and found that 5.6% of them met the criteria for PG. Factors associated with PG included unhealthy lifestyles such as skipping breakfast, physical inactivity, late bedtime, frequent irritability, frequent feeling of school avoidance, fewer close friends, low academic performance, no child-parent interaction, and no rules at home. Parental involvement appears to be an important factor in preventing PG in children. This article was authored by Masaaki Yamada, Michikaza Sikain, and Takashi Tatsus.


This video is brought to you in part by TrueTech Tools, quality tools, essential support. All right guys, so today we're working on a self-contained beer cooler. So the problem they say is that it sounds like it's making funny drip noises. Just got here, got to look at it and let's see what we got. So what we've got here is a self-contained little unit. You've got a compressor section here, you've got a compressor section there. According to this, we're on about 39-40 degrees. It's a Kaiser Warner. Looks like it. Our 22 holds eight and a half pounds. I don't know if that's between the two of them or per section. Not 100% positive on that yet. First one like this, I've worked on this particular design. So anyhow, we've got this unit here. You can hear it. All right, like I was saying, the filter dryer here is not even warm. It's kind of cold. Discharge off the compressor, hot gas.  That makes me wonder, are we grossly overcharged? What's going on here? Receiver's not warm. Compressor just does not appear that it's pumping. So let's go ahead and see if we can get this ice off here so we can maybe hook a suction port up and see what we got going on. All right, let's see what we got here. I'm going to say we're probably overcharged or we have some issues with the coil. Oh, it's nice.  This thing's flooding back so bad, but it's pretty obvious what's going on. We have about a 7 psi evaporator, 120 discharge, which is 70 degrees. So we're about 20 degrees over ambient, but yet we're running a negative 24 evaporator. We've either starving, plugged up coil with ice, restricted airflow. We're going to have to unload this thing. We got all the alcohol underneath there and get these covers out. And guess what? Surprise, surprise, surprise. We got us an evaporator here. It's all froze up. Wonder what happened here. Let's just keep on running it. Yes, sir.  And if I melt all that out, they're going to have water everywhere and it's just going to pump that water out of there right up somewhere, you know, to a pan that's going to overfill everywhere. See that? Or vacuum it out while we do it. So I'm not sure what we need to do next. I'm going to probably get my camera out. We'll inspect this other corner over here. All right. So we're going to try out this new camera here, which I've been using it and I've been pretty happy with it so far. This is a TrueTech Tools product they sell. As you can see, it's a pretty little guy. And I'm going to show you what's really cool about it. For starters, I don't have a 16 foot camera that takes, you know, you have to be on loop, de-duped. This one here doesn't hold memory like my other one did. So we take off the little protector there on the end and here's what's really cool about it. Watch this rotate it and actually bend all the way back around and you can actually look around and see what's going on. So that makes it very easy. And the display is really big. I guess if I was thinking a little closer, I would have realized that this piece of metal here is right there where they're going to hit it at. But if we go right here on the side, we should be able to see if there's any ice there. So let's take a look at that. Kind of go left and right to see where we're at. There's the coil. See the coil right there on the side right here where we're able to see. So you've got this red orange thing here in the middle. It tells you whether you're straight on or not. So I'm able to turn it and look back at myself. You can see my hand right there. Okay, from what I'm seeing, you can see the end loops just plain as day. So obviously we're not dealing with that and you're not hearing the funny noises that we're getting out of the other stuff. I'm going to see if we can find out whether or not this is what happened the last time somebody was out here or what, but definitely is an issue. We can actually turn the fan off and come down to the top. There we go. I got everything crammed in here. Okay, we're able to put that right down through there and you can see we can turn our camera and maneuver to see exactly what's going on. You can see that the fan is right there. You can see the coil. Don't look too bad. I mean it's got dirt on it, but you can also see the temperature. There's 92 degrees. This does video recording and still photography also does Wi-Fi and you can send it by Bluetooth or Wi-Fi. I believe it's both of them or one or the other either way. You can get it to your phone to send it out to somebody, but you can see firsthand that that coil looks fine. This is the only one I've seen with that articulating head. Yeah, I've got my other one can go side shot, but the problem is that long wire is a pain in the hind end. Now this is a little more expensive than the one I was using. I'll give the link for this down there. True Tech Tools. I want to save 8% on it, use survival, check out and check it out. So anyhow, let's go ahead and get back to this. So that was just one example how I can use some of the tools to make my job a little easier versus tearing the whole thing out. One of the guys told me that there was a manual for some of the other cases back there somewhere else and I found it. So now I can figure out how this works. At first I was like, oh, look at that. There's no buttons. Well, guess what? That flips up and here is your display to tell you what you're doing. So we're gonna go through here and check some of our temperatures. See if that sensor's bad. It appears this does not have a heated off defrost cycle. So it's probably just timed off only. Let's go ahead and hit manual defrost or tap it once and don't do anything. So let's hold it. There we go. Compressor shut off and the compressor is still running and we're in defrost. So our problem might be that our contactor is sticking. I heard it click which ain't good. So let's go ahead and grab the meter and see if we got power to the coil on the contactor. We may have just found our problem. That or the control modules jump on the other, neither of which would really surprise me. Any power on the contactor. Check that out. See both. You can see the display there. You can see the contactor. So we're going down here to the coil. Going to that one and going to that one. No voltage. Make sure our meter works. Let's go to one of the power legs to ground and see if we got power yet. There's 118. So if we go here to this contactor and pull that off like that and it's still running, that means your contactor's bad. Look at that. It shuts off. So I would say our problem here is the contactor's burnt and that is what's causing it to freeze up because it never shuts off. And that compressor is more powerful obviously than the heaters. Let's go down here and check amp draw and make sure these heaters are working. So I am not picking up any amp draw on that. Nothing on that. Let's go to the main power legs here. Not getting nothing there. So not only do we have a bad contactor, we have a potentially bad heated coils. That's if it has elements I don't know yet. I mean it sure looks like it's got it. Let's go over here and look at the schematic here. So here's the run capacitor relay, high pressure switch, compressor overloads, you can insert fans. Don't see anything. Ballast. It's all these things. Ballast, ballast, ballast, condensate evaporator fan, fan, condensate evaporator fan. So yeah, this does have like a heated pan back here. You can see that dirty nasty looking thing. So that's how it does that. So I don't see anything in here showing me any heated elements. So I bet you that must be ballasts. It's probably lighting the circuits of some sort. We could probably grab the vacuum cleaner and sweep it out as it's melting and then keep dumping it into a bucket until we finally get it all melted. We could do this probably with a pump sprayer of some sort. Yeah, it looks a little burnt. Yeah, it's a little burnt. So if you wanted to, you could have divided the power between the two legs and give yourself total probably 40 amps of capacity or 50. I'm sure it's rated for 30 amps of 60 amps capacity, but in reality it should, you know, it should last longer possibly. Which if we got a dual contactor, it's probably what I'll do is I'll just divide it between the two of them. We'll split top and bottom together. Give you a little extra capacity. Also, if I would have been standing up, I would have seen that the fan is still running. So you're not usually going to run the fan while the heater elements are on. And that definitely be an issue. So I have seen it on some of these older cases, but generally you don't do that. Okay, we're going to go ahead and turn power off to this. We're going to double check, make sure both legs broke like it should. So we're going to go down here to the bottom, check the ground, between the two of them, nothing. So we're good. So now we're going to get this contactor change, which ain't rocket science. Get our coils back on there. I was going to do a underneath there, but they didn't put the nice flat pieces under there. So we're going to have to go ahead and use spade terminals or just to make it simple, go ahead and use the same push-on terminals. I don't usually like these for high air amperage things, but since we're only talking probably nine amps or 10 amps, it's not going to be that big of a deal. But you know, it's funny even on electric furnaces, they still use those type of connectors a lot of times and don't use the eyelets. This top piece to this top and this bottom to the bottom. That way it'll both open up together. Everything will be just fantastic. Just going an extra mile, you know? It's little things like this that make a difference. Is it necessary? No, but it might prevent a problem a little bit longer than if we didn't do it. And since we got it like that, why not? All right guys, so we've got that connected here. I'm going to go ahead and hook this up for just a second to make sure that it kicks on and kicks off, telling me whether the controller's working. So we'll kick it on. So there comes on the lights. The compressor should kick on here in a second. If it does, I'll put it into defrost, make sure it disconnects.  So while I'm gone, I'm going to pull this off the coil so that it continues to run the fan and melts the coil or melts the ice off of it while I'm gone. So I don't, you know, we've got something more important I got to go do. Okay, we're waiting on that. Let's go and get this back together. That way I don't forget about it later. So I always like putting everything back together that way. Just like I said, you don't forget it because it's easy to do. You get busy on something else. We had two of these booklets at the other and this should kick on here in a second I think. Now I will probably need to turn the alarm off on this case for this particular sensor because it's probably going to go into alarm. All right, it's back into running. Let's put it into defrost.  Let's go ahead and disconnect that. We'll tape that off. That way it doesn't shorten anything and then like I said, we'll take off. Okay, here's the map of the store. Here's that eight foot cold beer, two dash seven. See it's blue. Might be rack A but the thing is it's not on the rack but that's where they put it at I guess. Usually that'd be. So let's see if we find that. All right, there's circuits, no beer there. Circuits, eight foot beer, SC. So let's go down here. They only have one temperature sensor. I swear they had two temperature sensors. They're SC eight foot beer. Yep, SC. So it must be average. You would think if it was averaging they wouldn't have, they'd have to have two of them. So let's go. Yeah, I see it's already up to 40. Let's go down here to setup. Let's go to log in. Now we're logged in. Undefined, case type, self-contained. So now you know SC self-contained. Set points 32 which is jack. It runs on its own thing. Alarms, case high alarm 50 degrees. So yeah, it's not even gonna go off most likely anyway. That's nice but it's beer but still nice to have an actual indication of what's going on. Let's go ahead and let it go. I think we're gonna be fine. I'm not gonna screw with it. So I came back to the store and the coil had completely defrosted itself. It took a couple hours. I went up there to help another guy fix the leak on one of the racks. We got that fixed. Here's a couple pictures of that. Basically it was in a real bad spot. You can see the damage here on this fitting right here.  So when I got back everything was already thawed out. It was running fine. Well you know the system was starting to freeze up just because the compressor was never shutting off and it wasn't going to defrost. The noise was liquid refrigerant going back into the compressor which was that drip noise you heard in the beginning. Right now all we're doing is a bunch of maintenance so there's not a whole lot to record. So here's what you got. So thanks for watching guys. Appreciate it. Till next time, later.