Lab 2B
Directions: Follow along with the slides and answer the questions in red font in your journal.
colors
.min
, max
or range
functions. These functions use a similar syntax as the mean
function.min
value and max
value for your predominant color.range
function to your predominant color and describe the output.
range
function calculates the maximum and minimum values for a variable, but not the difference between them.Range
function that will calculate the difference.dotPlot
of your predominant color’s scores. Make sure to include the nint
option.add_line(vline = )
to add vertical lines at the quarter marks.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
.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
. This will store the output from the range
function in the environment pane.diff
function to calculate the difference of values
. The input for the diff
function needs to be a vector containig two numeric 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.mm_diff
function will appear in your Environment pane.mean
and median
values of your predominant color: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 capital ‘R’) that calculates the range of a variable by filling in the blanks below:Range
function to find the personality color with the largest difference between the max
and min
values.myIQR
that uses the quantile
function to compute the middle 30% of the data.