Lab 1B
Directions: Follow along with the slides, completing
the questions in blue on your
computer, and answering the questions in red in your
journal.
Space, Click, Right Arrow or swipe left to move to
the next slide.
cdc
data.View
your cdc
data and
find the columns for height
and sex
(use the
History pane again if you need help to View
your
data).
height
a numerical or categorical variable?
Why?sex
a numerical or categorical variable?
Why?height
and
sex
.names
of your cdc
data’s variables
(use the code displayed in the History pane to resubmit
previously typed commands). Use the code’s output to help
you complete the following:
cdc
in the Environment pane.str
ucture of your
cdc
data and answer:str
function
output?bargraph
and a
histogram
for each variable.
bargraph
or
histogram
, is better at visualizing categorical variables?
Which is better at visualizing numerical variables?weight
.
weight
. Make sure
to describe the shape, center and spread of
the distribution.nint
option which
controls the number of intervals in a numerical plot.
nint = 3
change
the histogram
?nint = 3
impact how you would
describe the shape, center and spread?nint
. What value produced
the best graph? Why?bargraph
:groups
argument in your
code change the graph?groups
argument to create a
histogram
for the height
of males and
females.
groups
argument uses color to differentiate between
groups.histogram
to answer the questions
below:histogram
,
is it possible to create a split bargraph
? Try to
create a bargraph
of drive_text
that’s split
by sex
to find out.cdc
data, make a
graph, and use the graph to describe how drive_text
use
differs with this variable.