Lab 2B
Directions: Follow along with the slides and answer the questions in red font in your journal.
colors
.min
, max
or range
functions.min
value? Which had the largest max
value?range
function to calculate the max
and min
values of your predominant color
range
function calculates the maximum and minimum values for a variable, but not the difference between them.range
function to assign
the max and min values of a variable the name values
.diff
function to calculate the difference of values
.function
.mm_diff
to calculate the absolute difference between the mean
and median
value of a variable
in our data
.mm_diff <- function(variable, data) {
mean_val <- mean(variable, data = data)
med_val <- median(variable, data = data)
abs(mean_val - med_val)
}
variable
and data
{}
mean
and median
functions.mean
and median
values of your predominant color:____(~____, data = ____)
mean
and median
values?
dotPlot
for this personality color, make an argument why either the mean
or median
would be the better description of the center of the data.Range
(Note the capial 'R') that calculates the range of a variable by filling in the blanks below:____ <- function (____, ____) {
values <- range(____, data = ____)
diff(___)
}
dotPlot
or histogram
to find the personality color with the largest difference between the max
and min
values. Then use the Range
function you created to calculate its range.quantile(~____, data = ____, p = 0.25)
dotPlot
of your predominant color's scores.IQR
is another way to describe spread.
min
and max
to compute the range
, we can also use the 1st and 3rd quartiles to compute the IQR.iqr()
function to calculate it for you.dotPlot
, how would you teach them to make a boxplot? Write out your explanation in a series of steps for the person to use.
bwplot
function to create a boxplot using R
.favstats(~____, data=colors)
myIQR
that uses the only quantile
function to compute the middle 30% of the data.