1/143
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Why are averages alone insufficient for describing numerical data?
Datasets can have similar averages but very different variability, shapes, and unusual observations.
Which center-and-spread pair should you usually report for roughly symmetric data without major outliers?
Mean and standard deviation.
Which center-and-spread pair should you usually report for strongly skewed data or data with major outliers?
Median and IQR, because they are more resistant to extreme observations.
What should you consider when a distribution has multiple prominent peaks?
Whether it combines meaningful subgroups that should be analyzed separately.
What should you do before deciding how to handle an extreme observation?
Investigate its context and possible errors, plot the data, and compare summaries with and without it.
What is a z-score, and what is its formula?
The number of standard deviations an observation is above or below its own mean: z = (observation - mean) / standard deviation.
What does the sign of a z-score tell you?
Positive means above the mean; negative means below the mean; zero means equal to the mean.
How do you compare unusualness using z-scores from different variables?
Use each variable's own mean and SD, then compare absolute z-scores. The larger absolute value is farther from its own mean in SD units.
In the Game of Thrones example, viewers have z = 2.64 and the rating has z = -5.04. Which is more unusual?
The rating, because 5.04 is greater than 2.64 in absolute value. Its negative sign indicates that it is below the mean.
In an ungrouped dataset, what does summarize() do?
Calculates summary statistics and returns one row containing those summaries.
What does rapidcity %>% summarize(avg_temp = mean(Temp)) calculate?
The mean of Temp in rapidcity, stored in an output column named avg_temp.
How do you request multiple statistics inside summarize()?
Separate the named calculations with commas. Example: summarize(avg_temp = mean(Temp), median_temp = median(Temp)).
Which R package enables the formula-style summary shortcuts in the slides?
The mosaic package. Load it with library(mosaic).
How do the mosaic shortcuts calculate a numerical variable's mean, median, SD, and IQR in df?
mean(~num, data = df), median(~num, data = df), sd(~num, data = df), and IQR(~num, data = df).
What does favstats(~num, data = df) return with mosaic loaded?
A table containing the minimum, Q1, median, Q3, maximum, mean, SD, number of nonmissing observations, and number of missing observations.
What is the difference between R's range() output and the statistical range?
range() returns two endpoints: minimum and maximum. The statistical range is maximum minus minimum.
What are the three basic elements of the grammar of graphics?
Data variables, geometric objects, and mappings from variables to the objects' aesthetic properties.
What are geometric objects in a plot?
The visual marks representing data, such as points, lines, bars, and boxes.
What is an aesthetic mapping?
A connection between a data variable and a visual property, such as x-position, y-position, color, shape, or size.
How do the three graphics elements match the textbook's sentence analogy?
Variables are like subjects; geometric objects are like objects; mappings are like verbs that connect them.
What does 'a plot maps variables to aesthetic properties of geometric objects' mean?
Data values determine how visual marks appear or where they are placed. For example, engine size determines a point's horizontal position.
Can the same data be displayed in different valid plots?
Yes. Changing the geometric objects or aesthetic mappings can emphasize different comparisons while using the same variables.
In the bike-rental line graph, what are the three variables and their mappings?
Hour maps to x-position; median rentals maps to y-position; working-day status maps to the color of the points and lines.
In the faceted bike-rental bar plot, how is working-day status displayed?
It determines the panel. Within each panel, hour determines bar position and median rentals determines bar height.
What pattern does the bike-rental example show?
Working days have morning and evening demand peaks; nonworking days have a broader midday plateau.
What are the five fundamental plot types in this lesson?
Scatter plot, line graph, histogram, boxplot, and bar plot.
Which plot is appropriate for examining the association between two numerical variables?
A scatter plot, with one numerical variable on each axis.
Which plot is appropriate for showing a numerical variable across time or another meaningful sequence?
A line graph, with the sequential variable on the horizontal axis in the usual orientation.
Which plot is appropriate for examining the distribution of one numerical variable?
A histogram.
Which plots are appropriate for comparing a numerical variable's distribution across categories?
Side-by-side boxplots or faceted histograms.
Which plot is appropriate for comparing summary statistics across groups?
A bar plot, with a bar representing a count, proportion, mean, median, or other summary for each group.
What should determine your choice of plot?
The types of variables, whether you have raw observations or summaries, and the comparison or question you want to investigate.
What does each point in a basic scatter plot represent?
One observation, positioned using its values for the x and y variables.
What can a scatter plot reveal besides an overall association?
Clusters, subgroups, unusual observations, and relationships that may be curved rather than straight.
What does an upward or downward pattern in a scatter plot suggest?
Upward: larger x-values tend to accompany larger y-values. Downward: larger x-values tend to accompany smaller y-values.
In the mpg scatter plot from your notes, what are displ and hwy?
displ is engine displacement in liters; hwy is highway fuel economy in miles per gallon.
What pattern appears in the mpg scatter plot of hwy versus displ?
Vehicles with larger engine displacement generally have lower highway miles per gallon: a negative association.
What question helps you choose between a scatter plot and a line graph?
Does x have an inherent progression or meaningful sequential order? If not, connecting points with lines usually does not make sense.
Must the horizontal variable in a line graph be time?
No. Time is common, but another meaningfully ordered sequence can also be appropriate.
In what order does geom_line() connect observations within a group?
In order of the x-variable, emphasizing the progression along that axis.
What is a histogram bin?
A non-overlapping numerical interval containing observations within a particular range of values.
What do the axes of an ordinary count histogram show?
The horizontal axis shows numerical values grouped into bins; the vertical axis shows the number of observations in each bin.
What does the sum of all bar heights equal in an ordinary count histogram?
The number of observations included in the histogram, because each observation is counted in one bin.
What distribution features can you investigate with a histogram?
Center, spread, modality, symmetry or skewness, tails, gaps, and unusual observations.
How do you identify the direction of skew in a histogram?
Look at the longer tail: a longer right tail means right skew; a longer left tail means left skew.
What happens when histogram bins are very narrow?
They reveal finer detail, but the plot can become spiky and noisy.
What happens when histogram bins are very wide?
The plot looks smoother but may hide meaningful detail, peaks, or gaps.
Is there one best histogram bin width for every dataset?
No. Try several widths and use the context to balance meaningful detail against noise.
Does changing histogram bin width change the original observations?
No. It changes how the observations are grouped and displayed, which can change the apparent shape.
What is a density histogram?
A histogram rescaled so that the total area of its bars equals 1. Bin areas represent proportions of observations.
Does a density histogram's bar height directly equal the proportion in that bin?
Not generally. Proportion = bar height multiplied by bin width. Density is a height; probability or proportion is an area.
How does a percentage histogram differ from a density histogram?
A percentage histogram puts percent of observations in each bin on the vertical axis. In a density histogram, bar area represents the proportion.
Why use density histograms to compare groups with different sample sizes?
Each group's total area is standardized to 1, so differences in sample size do not dominate comparisons of distribution shape.
Does switching from a count histogram to density scaling change its shape when the bins stay the same?
No. It changes the vertical scale, not the shape.
What does a boxplot summarize?
The distribution of a numerical variable using its median, quartiles, whiskers, and any separately displayed extreme observations.
What is the five-number summary?
Minimum, Q1, median (Q2), Q3, and maximum.
What do the box edges and the line inside a boxplot represent?
The box edges are Q1 and Q3. The line inside is the median, or Q2.
What fraction of observations does a boxplot's box represent?
The middle 50%, from the 25th percentile (Q1) to the 75th percentile (Q3).
How do you calculate the IQR, and where is it shown in a boxplot?
IQR = Q3 - Q1. It is the box's length along the numerical axis: height for a vertical boxplot, width for a horizontal one.
What are the usual 1.5-IQR fences for a boxplot?
Lower fence = Q1 - 1.5 times IQR. Upper fence = Q3 + 1.5 times IQR.
Where do the whiskers end in the default modified boxplot?
At the most extreme observed values within the 1.5-IQR fences. They need not reach the minimum, maximum, or the fence values themselves.
What do separate points beyond boxplot whiskers mean?
They are observations beyond the usual 1.5-IQR fences. They are worth investigating and are not automatically errors.
What can the median's location inside the box and unequal whisker lengths suggest?
Asymmetry or skewness. A boxplot gives clues, but a histogram shows more detail about the distribution's shape.
What is within-group variation in a set of boxplots?
The spread among observations within one group, such as week-to-week sales variation within one city.
What is between-group variation in a set of boxplots?
Differences across groups, such as differences in median weekly sales between cities.
Why compare differences in group medians with within-group spread?
Within-group spread gives context: a difference between medians may be small or large relative to ordinary variation among observations.
When might a faceted histogram be more useful than a boxplot?
When comparing a small number of groups and you want detail about each distribution's shape, including multiple peaks.
When might side-by-side boxplots be more useful than faceted histograms?
When comparing many groups, because boxplots summarize each distribution compactly.
What data do you need for a meaningful boxplot compared with a simple bar plot?
A boxplot needs multiple numerical observations within a group to describe its distribution. A simple bar can display one supplied summary value per group.
What does a bar's length or height usually represent?
A group-level summary, such as its count, proportion, mean, median, or total.
What are the two usual stages of making a bar plot from raw data?
First calculate a summary for each group; then plot those summaries as bars. For simple counts, geom_bar() can do the counting.
How is a histogram different from a bar plot?
A histogram groups numerical observations into ordered intervals. A bar plot compares categories using counts or other summaries.
Can histogram bins be rearranged from tallest to shortest like some category bars?
No. Their positions represent numerical intervals, so rearranging them would destroy the meaning of the numerical axis.
Why should the value axis of a standard bar plot include zero?
Bar length encodes magnitude. Truncating the baseline can make modest differences look much larger than they are.
How should categories be ordered when they have a natural order?
Use that order, such as chronological months, increasing age groups, or low-to-high ratings.
How might you order categories that have no natural order?
By the plotted value or another meaningful comparison, rather than automatically accepting alphabetical order.
When are horizontal bars especially useful?
When category labels are long and would overlap or need awkward slanted text on a horizontal axis.
What is a grouped bar plot?
A bar plot with separate bars beside one another within each main category, usually showing levels of a second categorical variable.
What is a stacked bar plot?
A bar plot that divides each bar into segments representing subcategories, showing their contributions to the total.
What does a 100% stacked bar plot emphasize?
Each bar totals 100%, so the segments show composition or proportions within groups rather than differences in total group size.
What is faceting, also called small multiples?
Splitting a plot into separate panels of the same type, with each panel showing a subset of the data.
What is a faceting variable?
The grouping variable that determines which observations appear in each panel.
What type of variable is usually used for faceting?
A categorical grouping variable. Numerical values can also define panels when they represent meaningful groups, such as numbered months or binned ages.
Why should comparable facets usually use the same axis scales?
The same visual distance then represents the same numerical difference, allowing direct comparisons across panels.
Can faceting be applied only to histograms?
No. It can also be used with scatter plots, line graphs, bar plots, and other plot types.
When might faceting be clearer than placing every group on one plot?
When many overlapping lines, points, bars, or colors make individual groups hard to follow.
How can a scatter plot display a third categorical variable?
Map it to point color or shape, or use it to create separate facets.
Which aesthetics can encode an additional numerical variable in a scatter plot?
Point size or transparency can encode numerical values. Color gradients are another option.
What does alpha control in a plot?
Transparency: lower alpha makes objects more transparent, while higher alpha makes them more opaque.
Why are color or shape generally better than size for distinguishing unordered categories?
Color and shape distinguish group identity without suggesting a numerical magnitude or ordered progression.
What is overplotting?
Points or other marks overlap and hide one another, making observations or patterns difficult to see.
What does a jitter plot do?
Displays individual observations with a small random displacement so overlapping points are easier to distinguish. The displacement is for display, not a change to the source data.
When can a jitter plot be useful compared with a boxplot?
For smaller datasets when seeing individual observations within each group is helpful.
What workflow do your notes recommend for making plots?
Start with a simple exploratory plot to find patterns, then refine the plot to communicate those patterns clearly.
Why is simpler often better in data visualization?
Removing unnecessary decoration and clutter helps viewers focus on the data and comparisons.
Why can too many lines and a large legend make a plot hard to read?
Viewers must repeatedly match colors to labels and track overlapping series. The slides suggest that more than about 5 to 7 series can be difficult.
How can you reduce the effort of matching lines to a legend?
Label the lines directly where practical, or use clearly labeled facets.
What should you consider when choosing colors to encode data?
Use a colorblind-friendly palette, and consider shapes or direct labels so readers do not have to rely only on color.
What should good axis labels include?
Clear variable descriptions and units when applicable, so the audience can interpret the values.
What is the recommended approach to learning detailed plot-customization code?
Use working examples as templates and copy, paste, and tweak them. Focus on understanding what each change does rather than memorizing every option.