So we're going to have a little overview of different plots, we can make for
describing the relationship between two variables: one categorical and one
numeric, variable two categorical variables, and then two numeric variables
A quick reminder to subscribe and click on the bell to receive notifications
when we upload new videos
Plots are a great way that we can visualize and
explore whether or not two variables are associated and the nature of that
association If they are. Later on, we're going to talk about analytic techniques
we can do to analyze the relationship between two variables; if you recall
variables are either categorical or numeric and the plots we can make as
well as the methods of analysis depend largely on the type of variables that
we're looking at; so let's start off with one categorical, one numeric: the plot we
can make here: side by side box plots; so one example we can think of let's draw
this here
So let's say we were looking at does someone have skin cancer yes and no
and the other variable: how many hours per day in the Sun and
what we'd likely see is for those with skin cancer here's the distribution of
the number of hours in the Sun and for those without we'd likely to see that
distribution a little bit lower; okay so here we can see through this plot there
is an association those who have skin cancer tend to an average be spending
more hours in the Sun than those that don't and just for the sake of talking
about what no association would look like, let's think of looking at
biological sex: male or female so that's our categorical variable and our numeric
variable: body temperatures and if we make a plot of the body temperature
distribution for males and for females it probably end up looking
pretty similar okay so this is a visual of the Reno Association so these are
very commonly seen plots and a lot of papers or discussions they really help
us describe relationship between one categoric and one numeric variable so
now let's think about plots that we can make for two categorical variables here
there's a number of different plots that exist each with good and bad qualities
to them so the first one we'll talk about is side by side bar charts okay
and so the example I'm going to use for our two categorical variables the first
one we'll think there's someone smoked or do they not smoke okay and the other
variable we'll look at do they have lung cancer yes or no so on this access we'll
put the percentage and what we'd like to see is something like this and going
from 0 up to 100% and here I'm drawing it so well let me label these we'll do
this - here as those who have lung cancer and
we'll do it with no dashes for the group with no lung cancer okay so here for
those who smoke roughly 1/3 are getting lung cancer 2/3 or not
for those who don't smoke roughly about 10% getting lung cancer 90% not getting
lung cancer ok so again here we can see there's an association another version
similar is a stacked bar chart and it's pretty similar to the side by side bar
chart except we take these and we stack them on top of each other okay so taking
the exact same set of data but looking at it as a stacked bar chart here's the
smoking group here's the non-smoking I'll just abbreviate that and s again
here's the percentage going from 0 up to 100 and we'd have roughly 1/3 getting
lung cancer 2/3 not ok so again the dashed lines for those with lung cancer
the no dashed line of those with no lung cancer for the non-smoking group we had
roughly 10% with lung cancer and about 90% with out ok so pretty similar plot
to the side-by-side except we stack them vertically so again here we
can see there appears to be an association now another plot and this is
one that I like a little bit more is a mosaic plot and that's because it
conveys a little bit of extra information so let me draw that in here
and then label what some of the parts are and what's being shown in that so
for the most part it's pretty similar for this stacked bar chart except if we
pushed these two stacks together here is the smoking and here is the non-smoking
and remember in our example we said there's roughly for the smokers 1/3
getting lung cancer 2/3 or not so let me label that again over here these are the
group with lung cancer and the unshaded is the group without lung cancer and for
the non-smokers so about 10% getting lung cancer 90% not so let's talk about
this plot for a moment ok so this plot shows pretty much what we saw in that
stacked bar chart so let me go and label those we can see for the group that
smokes we can see roughly 1/3 are getting lung cancer in other words for
those who smoke roughly 1/3 get lung cancer anybody for those who do not
smoke right so this total stack is a hundred percent roughly 10 percent are
getting lung cancer right so again for those who do not smoke roughly 10
percent get lung cancer ok so it's showing pretty much what we could see in
that stacked bar chart except it conveys this extra info as well the width of the
smoking and non-smoking stack tells us the proportion of smokers and
non-smokers so this goes from 0 up to a hundred as well and this distance here
gives us the percentage who smoked and this distance here gives us the
percentage who do not smoke ok so again pretty similar to the stacked bar chart
except it gives this one extra additional piece of info the width of
the bars for the smokers and non-smokers tells us the proportion of our sample
that smokes or does not smoke now I'm just going to draw one more mosaic plot
I won't label this much but I'm going to draw this
same plot but if there was no association between smoking and lung
cancer the way that plot would end up looking and again all the same X and
y-axis it would end up forming roughly a cross pattern okay what that's telling
us here is the proportion getting lung cancer for those who smoke and those who
do not smoke are roughly the same okay there is no association between the two
okay so like I said the mosaic plot that's my favorite out of these because
it it conveys the most info in one picture the final set is talking about
describing the relationship between two numeric variables and to do this we can
use a scatter plot okay which sometimes gets called an XY plot I've run out of
space so I'm just going to draw those in over here so again I'll do two examples
one with an association one without so we might say look at age going from 0 up
to 20 okay so these are looking for a group of children don't care kids and
here is height and what we'd like to see is something like this as age increases
height is increasing right there's an association between the two what would
this plot looked like if there was no association here's age and now let's do
it for a group of adults so let's say going from age 20 up to age 65 and again
on this axis we're looking at height we would just see a cloud of points right
no real association and that's for a group of adults there's not really an
association between your age and height between the ages of 20 and 65 we're done
growing and we're not quite sure inking yet so later on we're start to learn
different methods of analyses that we can do depending on the type of data we
have just to mention the quick keywords now one categorical one numeric we can
look at things like two sample t-test analysis of variance and other methods
two categorical variables we met look at chi-squared test
fishers test odds ratios rate ratios these sorts of things and two numeric
variables Pearson's correlation or Spearman's correlation simple linear
regression and those thanks for watching our video
subscribe to a channel chill radios certificate is almost as young man's
chocolate stick around guys cuz we are not more