What you will learn in Statistics Slam Dunk
Statistical analysis with R on real NBA data
Chapter by chapter
Concepts explained in this book
- group_by()The group_by() function from dplyr assigns grouping variables to a tabular object so subsequent operations can be performed separately within groups.
- filteringThe filter() function is a dplyr function that returns rows of a tabular object satisfying specified logical conditions.
- Gini coefficientA Gini coefficient is a summary measure of inequality derived from the area between a Lorenz curve and the line of perfect equality, typically ranging from zero for complete equality toward one for greater inequality.
- select() functionThe select() function is a dplyr function that selects or deselects data-frame columns by name, position, or selection expression.
- categorical dataA categorical variable records observations as membership in one of a finite set of qualitative categories.
- as.factor() functionThe as.factor() function in R converts a vector into a factor representing categorical levels.
- mutate() functionThe mutate() function from dplyr creates or modifies columns in a tabular data structure using expressions evaluated against existing columns.
- p-valueA p-value is the probability, under a specified null hypothesis, of obtaining a result at least as extreme as the observed result according to a test statistic.
- summarize() functionThe summarize() function from dplyr reduces grouped or ungrouped data to summary values computed from its columns.
- t-testA t-test is a statistical test that evaluates whether a difference between means is unlikely under a null hypothesis, typically using a t-distributed test statistic.
- z-scoreThe z-score method standardizes a numeric observation by subtracting its population mean and dividing by the population standard deviation.
- box-and-whisker plotA boxplot summarizes the distribution of a numeric variable using quartiles, a median, whiskers, and potential outliers.
- effect sizeAn effect size is a quantitative measure of the magnitude of a difference or relationship between groups or variables.
- team payrollA team payroll is the total amount a sports team spends on player salaries for a specified period or season.
- read_csvThe read_csv() function is a readr function that reads comma-separated-values data into an R data structure.
- ggplot2ggplot2 is an R graphics library for constructing statistical visualizations from data using a layered grammar of graphics.
- bar chartA bar chart is a statistical graphic that represents categorical values with rectangular bars whose lengths encode magnitude.
- derived variableA derived variable is a data variable computed from one or more existing variables rather than directly recorded in the original dataset.
- dplyrdplyr is an R package providing a grammar of functions for transforming and summarizing tabular data.
- sqldfThe sqldf() function executes SQL queries against R data frames and returns the query result as an R object.
- Cohen's dCohen's d is a standardized effect-size measure expressing the difference between two group means relative to a standard deviation, commonly the pooled standard deviation.
- correlationA correlation coefficient is a numeric measure of the direction and strength of the linear relationship between two variables, ranging from -1 to +1.
- histogramA histogram displays the distribution of one continuous variable by grouping observations into bins and encoding the count in each bin.
- 37% ruleOptimal stopping is the problem of choosing when to stop observing sequential opportunities to maximize an objective under uncertainty.
- dim() functionThe dim() function returns the dimensions of an R object, such as the number of rows and columns in a data frame.
- data explorationExploratory data analysis is the systematic examination of data using summaries, visualizations, and other descriptive methods before formal modeling or inference.
- income distributionAn income distribution describes how income values are allocated across members of a population.
- closing totalA closing total is the predicted combined score of the participating teams after wagers have been placed and the betting line has closed.
- opening totalAn opening total is the initial bookmaker estimate of the combined points scored by both teams in a game before subsequent market adjustments.
- null hypothesisA null hypothesis is a statistical proposition describing a baseline condition such as no effect, difference, or association.
- datasetA dataset is a collection of structured observations and variables representing recorded information for analysis.
- meanThe mean is the arithmetic average of a set of numeric observations.
- data wranglingData wrangling is the process of cleaning, transforming, reshaping, filtering, summarizing, and combining data for analysis.
- anomalyAn outlier is an observation that lies unusually far from the other observations in a distribution or dataset.
- glimpse() functionThe glimpse() function is a dplyr function that displays a compact transposed summary of a tabular object, including its dimensions, columns, and value types.
- standardizationStandardization transforms numeric variables to a common scale, commonly by subtracting the mean and dividing by the standard deviation.
- free throw attemptA free throw is an uncontested basketball shot awarded after specified fouls, typically taken from the free-throw line.
- pipe operatorThe R pipe operator passes the result of one expression as an input to a subsequent function call.
- logistic regressionLogistic regression is a statistical model that predicts the probability of a categorical outcome, typically by applying a logistic function to a linear predictor.
- alternative hypothesisAn alternative hypothesis is a statistical proposition that contradicts the null hypothesis by asserting an effect, difference, or association.
- correlation testingA correlation test is a statistical procedure for evaluating whether the association between two variables differs from a specified null value, commonly zero.
- statistical significanceStatistical significance is an inferential assessment that an observed result is unlikely under a specified null hypothesis at a chosen significance threshold.
- right-skewed distributionA right-skewed or positive-skewed distribution has most of its mass near smaller values and a comparatively long tail toward larger values.
- hot hand phenomenonThe hot hand phenomenon is the claimed tendency for successful outcomes in a sequence to increase the likelihood of subsequent success.
- optimizationConstrained optimization is the process of finding the best value of an objective function subject to specified restrictions.
- tally() functionThe tally() function from dplyr counts rows in a tabular object, optionally producing counts within established groups.
- Pareto chartA Pareto chart combines descending bars for unit frequencies or costs with a cumulative-frequency line plotted against a secondary axis.
- regression to the meanRegression to the mean is the tendency for an unusually high or low measurement to be followed by a measurement closer to the typical value when outcomes contain random variation.
- decision treeA decision tree is a predictive model that recursively partitions data using feature-based decision rules.
- K-means clusteringK-means is a clustering algorithm that partitions observations into a prespecified number of groups by minimizing within-group squared distances to cluster centroids.
- RR is a free, open-source programming language and environment for statistical computing, data analysis, and visualization.
- win sharesCareer win shares is a basketball performance metric representing the cumulative estimated contribution of a player to team victories across a professional career.
- interquartile rangeThe interquartile range is the difference between the third and first quartiles and spans the middle half of a distribution.
- winning percentageA regular season winning percentage is the proportion of regular season games a basketball team wins.
- rbind() functionThe base R rbind() function combines vectors, matrices, or data frames by rows into a single object.
- personal foul callA personal foul is a basketball violation involving illegal physical contact by a player against an opponent.
- headThe head() function is a base R function that returns the first observations of an object, defaulting to six rows for tabular data.
- dot plotA Cleveland dot plot compares values by positioning dots along a common quantitative scale.
- linear regressionA multiple linear regression model represents a target variable as a function of two or more predictor variables, typically using a linear form.
- independent variableA predictor variable is an explanatory variable whose values are used to predict or account for variation in a response variable.
- free throw percentageFree throw percentage is the proportion of a player's free throw attempts that result in made free throws, usually expressed as a percentage.
- hierarchical clusteringHierarchical clustering is a clustering method that builds a nested hierarchy of groups based on similarity or distance.
- DataExplorerDataExplorer is an R package that automates exploratory data analysis by generating data profiling summaries and visualizations.
- thresholdA significance threshold, or significance cutoff, is a prespecified probability cutoff used to decide whether statistical evidence is sufficiently inconsistent with a null hypothesis.
- ggplot() functionThe ggplot() function from ggplot2 initializes a layered statistical plot from data and aesthetic mappings.
- analysis of varianceA one-way ANOVA tests whether the mean of a numeric response differs across levels of one categorical predictor.
- quantile-quantile plotA normal QQ plot compares ordered residuals or observations with theoretical normal quantiles to assess compatibility with a normal distribution.
- continuous dataContinuous data consists of numeric observations that can take values across a range, including fractional values.
- closing point spreadA closing point spread is the sportsbook's final predicted scoring margin immediately before a sporting event begins.
- opening point spreadAn opening point spread is the initial bookmaker-implied margin between two teams when wagering markets open.
- varianceThe variance method measures statistical dispersion by averaging squared deviations from the mean.
- facet_wrap() functionThe facet_wrap() function creates separate plot panels for levels of a conditioning variable.
- probability distributionA distribution describes how the values of a variable are allocated across their possible range or categories.
- pivot_longer() functionThe pivot_longer() function from tidyr reshapes tabular data from wide format into long format by gathering multiple columns into key-value columns.
- tableonetableone is an R package for producing descriptive summary tables, commonly including baseline characteristics of datasets or study groups.
- chi-square testA chi-square test is a statistical test based on a chi-square-distributed statistic for assessing categorical-data relationships or distributional differences.
- Laplace's rule of successionLaplace's rule of succession estimates the probability of success on the next independent trial as (s + 1) / (n + 2), where s is the number of prior successes and n is the number of completed trials.
- as.numeric() functionThe as.numeric() function in R converts a compatible object into numeric values.
- missing valueA missing value or missing data item is an observation whose value is unavailable, unrecorded, or not applicable in a dataset.
- field goal percentageField goal percentage is the proportion of non-free-throw basketball shot attempts that result in made field goals, expressed as a percentage.
- tibbleA tibble is an R-specific modern form of data frame with enhanced printing and data-manipulation behavior.
- logitLog odds is the natural logarithm of the odds of an event, equal to the logarithm of its probability divided by its failure probability.
- average silhouetteThe silhouette method evaluates candidate clusterings by comparing each observation's cohesion within its cluster with its separation from other clusters, often using the average silhouette value to select a cluster count.
- correlation plotA correlation plot is a visualization showing pairwise association measures among variables.
- lollipop chartA lollipop chart represents values with stems ending in markers, often for comparing categories or ordered observations.
- SmartEDASmartEDA is an R package that provides automated exploratory data analysis through descriptive summaries, diagnostics, and visualizations.
- geom_histogram() functionThe geom_histogram() function adds a histogram geometry that bins continuous observations and counts them.
- quartileA quartile is a positional statistic that divides an ordered distribution into four equal-probability sections.
- Simpson's paradoxSimpson's paradox is a statistical phenomenon in which an association observed in aggregated data reverses or conflicts with the associations found in relevant subpopulations.
- cor.test() functionThe cor.test() function in R performs a hypothesis test for correlation between numeric variables and reports associated test statistics and p-values.
- medianThe median is the middle value of an ordered set of observations, or the midpoint of the two middle values when the count is even.
- area under the curveAUC is the area under a receiver operating characteristic curve, measuring a binary classifier's ability to rank positive cases above negative cases.
- accuracyModel accuracy is the proportion of instances that a classification model predicts correctly.
- confusion matrixA confusion matrix is a table that cross-classifies predicted and observed classes to count correct and incorrect classifications.
- error rateMisclassification error, or error rate, is the proportion of instances that a classification model predicts incorrectly.
- coin tossA coin flip is a binary random experiment with two possible outcomes, conventionally called heads and tails.
- sample() functionThe sample() function is a base R function that draws a sample or permutation from supplied values, optionally according to specified probabilities.
- trend lineA regression line is a fitted line that summarizes the predicted relationship between variables in a regression model.
- stringA character string is a sequence of text characters represented as a character value in R.
- left outer joinA left join is a tabular merge that retains all rows from one input and attaches matching values from a second input.
- factoextrafactoextra is an R package that provides functions for extracting and visualizing multivariate analysis results, including clustering results.
- glmThe glm() function is a base R function that fits generalized linear models, including logistic regression models.
- receiver operating characteristicA ROC curve plots a binary classifier's true positive rate against its false positive rate across decision thresholds.
- NBA datasetAn NBA dataset is a dataset containing records or measurements about the National Basketball Association and its games, teams, or players.
- visualizationData visualization is the graphical representation of data or analytical results to reveal patterns, comparisons, or relationships.
- recallSensitivity is the proportion of actual positive cases that a classification procedure correctly identifies.
- specificitySpecificity is the proportion of actual negative cases that a classification procedure correctly identifies.
- permutationA permutation without replacement is an ordered arrangement in which a selected element cannot be selected again.
- packageA software package is a distributable collection of code, data, documentation, and supporting resources that extends a programming environment.
- elbow methodThe within-cluster sum of squares method selects a clustering count by examining how within-cluster squared distances decrease as the number of clusters increases.
- inflation-adjusted dollarAn inflation-adjusted dollar is a monetary value converted to account for changes in purchasing power across time.
- arrange() functionThe arrange() function from dplyr orders rows of a tabular object according to one or more columns or expressions.
- geom_line() functionThe geom_line() function is a ggplot2 function that adds line segments connecting observations in their data order or a specified grouping.
- salaryA player salary is the monetary compensation paid by a sports team to an individual player, typically stated as an annual amount.
- library() functionThe library() function loads an installed R package into the current session.
- maximum likelihood estimationMaximum likelihood estimation is a parameter-estimation method that selects values maximizing the likelihood of the observed data under a model.
- McFadden's pseudo R-squaredMcFadden's pseudo-R2 is a goodness-of-fit metric for generalized linear models based on the log-likelihoods of a fitted model and a null model.
- standard deviationStandard deviation is a measure of the dispersion of numeric observations around their mean.
- c() functionThe c() function is a base R combining function that constructs a vector from multiple arguments.
- readrreadr is an R package for efficiently importing and parsing rectangular data files.
- pivot_wider() functionThe pivot_wider() function from tidyr reshapes long-format data into wide format by turning values of a variable into columns.
- normal distributionA normal distribution is a continuous probability distribution with a symmetric bell-shaped density determined by its mean and standard deviation.
- countThe count() function from dplyr counts observations by specified variables and returns the resulting counts in a tabular object.
- unsupervised learningUnsupervised learning is a machine-learning approach that discovers structure or patterns in data without labeled target values.
- randomnessRandomness is the absence of a deterministic pattern in the occurrence of outcomes, subject to probabilistic regularities.
- parityParity is competitive balance among teams in a sports league.
- whiskerA whisker is a line extending from a boxplot box toward the non-outlying lower or upper observations.
- ineq() functionThe ineq() function from the ineq R package computes inequality measures such as the Gini coefficient from numeric data.
- confidence intervalA confidence interval is an interval estimate constructed by a statistical procedure intended to contain a population parameter at a specified confidence level.
- home teamA home team is the basketball team designated as playing at its own venue.
- road teamA road team is the visiting basketball team designated as playing away from its home venue.
- bucketA bin is an interval used to group continuous numeric observations when tabulating or plotting their frequencies.
- na.omit() functionThe base R na.omit() function returns an object with observations containing missing values removed.
- centroidA centroid is the central position of a set of points, commonly calculated as the coordinate-wise mean.
- within-cluster variationWithin-cluster variance measures the dispersion of observations around the centers of their assigned clusters.
- geom_col() functionThe geom_col() function in ggplot2 creates bar layers whose heights directly represent supplied numeric values.
- rank functionThe base R rank() function assigns ordinal ranks to elements of a vector according to their values and tie-handling rules.
- manual exploratory data analysisManual exploratory data analysis is analyst-directed examination of data using individually selected summaries, visualizations, and analytical commands.
- geom_segment() functionThe ggplot2 geom_segment() function adds line segments between coordinates specified by x, y, xend, and yend aesthetics.
- f-testAn F-test is a statistical test based on an F-distributed ratio used to compare variances or assess model-related hypotheses.
- tabyl() functionThe tabyl() function is a janitor package function that creates frequency tables from categorical variables in R data.
- linear relationshipLinearity is the property that a relationship can be represented by a straight-line pattern or a linear function.
- Shapiro–Wilk testThe Shapiro-Wilk test is a statistical test that evaluates whether a sample is consistent with a normal distribution.
- Laplace probability curveA Laplace probability curve is the graphical form of a Laplace distribution, a symmetric distribution with a sharp central peak and exponentially decreasing tails.
- wide formatWide format is a tabular arrangement in which repeated measurements or categories are represented by separate columns.
- over/underAn over/under is a betting line representing the predicted combined score of opposing teams, with wagers determined by whether the actual score is higher or lower.
- Cramer's VCramer's V is an effect-size measure of the strength of association between categorical variables in a contingency table.
- probability theoryProbability is a numerical measure of the likelihood that an event or outcome occurs.
- clusteringCustomer segmentation is the division of customers into groups based on shared purchasing, demographic, or other attributes.
- permutation with replacementA permutation with replacement is an ordered selection in which an element may be selected again after it is used.
- hypothesisA hypothesis is a stated proposition about a population, process, or relationship that can be evaluated with evidence.
- loopA for loop is a control-flow construct that executes a block of code once for each value in a finite sequence or iterable.
- shapiro.test() functionThe base R shapiro.test() function performs the Shapiro-Wilk test of whether numeric data are plausibly drawn from a normal distribution.
- cbind() functionThe cbind() function is a base R function that combines compatible vectors or objects column-wise.
- Glass's deltaGlass's delta is a standardized mean difference obtained by dividing the difference between two means by the standard deviation of a reference group.
- Hedges' gHedges' g is a bias-corrected standardized effect-size measure for the difference between two group means.
- point spreadA point spread is a betting handicap expressed as a difference in expected scores between two opposing teams.
- plot_layout() functionThe plot_layout() function from patchwork specifies how multiple plots are arranged in a composed graphical object.
- nba_statsnba_stats is a book-specific tabular dataset containing NBA statistics across multiple seasons.
- as.Date() functionThe as.Date() function in R converts suitable values, especially character strings, into Date-class calendar dates.
- data subsettingData subsetting is the selection of particular rows or columns from a dataset according to specified criteria.
- multicollinearityMulticollinearity is strong dependence among explanatory variables in a regression model, making their individual effects difficult to estimate reliably.
- odds ratioAn odds ratio is the ratio of the odds of an event under one condition to the odds of the event under another condition.
- tidyverseThe tidyverse is a collection of R packages designed for data import, transformation, visualization, and related workflows.
- violin plotA violin plot displays the distribution and shape of numeric data by combining a mirrored probability-density shape with optional summary statistics.
- geom_text() functionThe ggplot2 geom_text() function draws text labels at positions specified by aesthetic mappings.
- generationThe predict() function is an R function that generates predictions from a fitted model for supplied data, optionally returning interval estimates.
- elbow pointAn elbow point is the location on a model-selection curve where additional complexity begins to yield sharply diminishing improvements.
- fviz_nbclust() functionThe fviz_nbclust() function from factoextra computes and visualizes criteria for selecting the number of clusters.
- kmeans() functionThe kmeans() function is a base R function that fits a K-means clustering model to numeric data.
- scree plotA scree plot displays a quantity such as within-cluster variation against the number of clusters to help identify an appropriate cluster count.
- silhouette coefficientA silhouette coefficient measures an observation's relative cohesion within its assigned cluster and separation from the nearest other cluster, typically ranging from -1 to +1.
- user-defined functionA user-defined function is a named, programmer-authored block of code that accepts inputs and returns a result or performs an operation.
- cut_short_scale() functionThe cut_short_scale() function from the scales package formats large numeric values with abbreviated scale suffixes such as M for millions.
- label_dollar() functionThe label_dollar() function from the scales package formats numeric values as currency labels with a dollar-sign prefix.
- causationCausation, or causality, is a relationship in which one event, factor, or variable produces a change in another.
- gglorenzgglorenz is an R extension package for constructing Lorenz curves within ggplot2 graphics.
- ineqineq is an R package that provides statistical measures and methods for analyzing income and other distributions of inequality.
- rename() functionThe dplyr rename() function changes column names in a tabular data object while preserving the associated data.
- scale_fill_discrete() functionThe scale_fill_discrete() function in ggplot2 configures the discrete fill scale, including its legend name and labels.
- team turnoverChurn is a book-specific dataset copied from records and augmented with team ranking and year-over-year postseason-status variables.
- tankingTanking is the deliberate weakening of a sports team to increase its future competitive prospects, typically by losing games and accumulating valuable draft assets.
- create_report() functionThe DataExplorer create_report() function generates an interactive HTML data profiling report by running multiple exploratory analysis functions.
- data profiling reportA data profiling report is a consolidated summary of a dataset's structure, completeness, distributions, and relationships.
- plot_correlation() functionThe DataExplorer plot_correlation() function computes and visualizes pairwise correlations among dataset variables.
- 80-20 ruleThe 80-20 rule is the heuristic that approximately 80 percent of an outcome is associated with approximately 20 percent of its contributing causes or members.
- theme() functionThe theme() function controls non-data visual styling and presentation settings in a ggplot2 plot.
- expected value analysisExpected value analysis evaluates uncertain decisions by comparing the probability-weighted payoffs of their possible outcomes.
- independent trialAn independent trial is an random experiment whose outcome probability is unaffected by the outcomes of other trials.
- geom_bar() functionThe ggplot2 geom_bar() function creates bar layers whose heights represent counts or supplied values according to the selected statistical transformation.
- %in% operatorThe %in% operator in R tests whether each element occurs in a specified vector or data frame.
- dendrogramA dendrogram is a branching diagram that represents hierarchical relationships or nested cluster structure.
- fitted valuesA fitted value is the response value predicted by a fitted statistical model for an observation or predictor setting.
- salary capA salary cap is a league-imposed limit on the total compensation a professional sports team may allocate to its players.
- facet plotA facet plot is a collection of subplots with shared axes, where each panel represents a group or factor in the data.
- levels() functionThe levels() function in R retrieves or sets the category labels associated with a factor.
- contingency tableA contingency table is a tabular arrangement of counts for combinations of categorical variables, with one variable represented by rows and another by columns.
- line plotA line chart represents values or trends across ordered positions by connecting plotted points with line segments.
- paired histogramA paired histogram is a visualization that places two related histograms together for comparison within a shared plot.
- str_sub() functionThe str_sub() function from stringr extracts or replaces substrings using character positions, including positions counted from the end.
- winsorizationWinsorization is a data-treatment technique that replaces extreme observations with less extreme boundary values rather than removing them.
- residual errorA residual is the difference between an observed response value and its fitted value in a statistical model.
- lagA lag is a sequence operation that aligns each observation with an earlier observation at a specified offset.
- range methodThe range method standardizes a numeric variable by dividing its values by the difference between the maximum and minimum values.
- Sankey diagramA Sankey diagram is a flow visualization whose link widths represent quantities moving between nodes.
- cor() functionThe base R cor() function computes correlation coefficients between numeric variables.
- standard deviation normalizationThe standard deviation method standardizes raw measurements by dividing them by their standard deviation without subtracting the mean.
- combinationA combination is a selection of objects or values in which the order of the selected elements does not matter.
- stat_compare_means() functionThe stat_compare_means() function from ggpubr adds statistical comparison results, including p-values, to a ggplot2 graphic.
- constraintA constraint is a condition that restricts the feasible values or combinations of variables in an optimization problem.
- ifelse() functionThe ifelse() function in R returns values selected elementwise from two alternatives according to a logical condition.
- power-law relationshipA power law is a mathematical relationship in which one quantity varies as a constant power of another quantity.
- complete linkageThe complete linkage method measures the separation between two clusters by the maximum distance between points in the different clusters.
- dist() functionThe dist() function in base R computes pairwise distances between observations using a specified distance measure.
- distance matrixA distance matrix is a tabular structure containing pairwise distances or dissimilarities between observations.
- Euclidean distanceEuclidean distance is the straight-line distance between points computed as the square root of the sum of squared coordinate differences.
- hclust() functionThe hclust() function in base R performs hierarchical clustering from a dissimilarity object and a clustering method.
- reorder() functionThe reorder() function changes the ordering of a factor according to values of another variable or expression.
- Lorenz curveA Lorenz curve is a cumulative distribution curve that shows the share of a quantity held by progressively ranked portions of a population.
- stat_lorenz() functionThe stat_lorenz() function is a gglorenz plotting statistic that computes and draws Lorenz curves from mapped data.
- date classA date class is an R object representation for calendar dates that supports date-specific storage and operations.
- base RA base R function is a function provided by the standard R installation without requiring an additional package.
- correlation matrixA correlation matrix is a square tabular arrangement containing pairwise correlation coefficients for a set of variables.
- win shares per 48 minutesWin shares per 48 minutes (WS48) is a basketball efficiency metric estimating a player's team-win contribution normalized to 48 minutes of playing time.
- select statementA SELECT statement is an SQL query construct that specifies the fields or expressions to retrieve from a data source.
- adjusted r-squaredAdjusted R-squared is a regression-fit statistic that estimates explained response variance while accounting for the number of predictors.
- ExpData() functionThe ExpData() function from SmartEDA returns tabular summaries describing a dataset's dimensions, variable classes, structure, and missing data.
- ExpNumStat() functionThe ExpNumStat() function from SmartEDA computes descriptive statistics for numeric variables, optionally including outlier and quartile information.
- ExpNumViz() functionThe ExpNumViz() function from SmartEDA generates visualizations of numeric variables, including density plots and scatterplots.
- ExpReport() functionThe ExpReport() function from SmartEDA generates a standalone HTML exploratory data analysis report from a dataset.
- score marginA score margin is the difference between the points scored by two opposing teams in a game.
- distinct keywordThe distinct() function from dplyr returns rows containing unique combinations of selected columns from a tabular object.
- residual plotA residuals-versus-fitted plot displays model residuals against fitted values to reveal nonlinearity, nonconstant spread, or other systematic patterns.
- scale_x_continuous() functionThe ggplot2 scale_x_continuous() function configures a continuous x-axis scale, including its limits, breaks, labels, and transformations.
- plot() functionThe plot() function is a base R generic function that produces graphical representations of R objects and fitted models.
- as.data.frame() functionThe as.data.frame() function in R converts an object into a data frame when a suitable coercion method exists.
- sankeyNetwork() functionThe sankeyNetwork() function is a networkD3 function that constructs an interactive Sankey network visualization from nodes and links.
- completenessIncomplete data contains missing, blank, or otherwise unavailable values for one or more recorded fields.
- kurtosisKurtosis is a statistic describing the tail heaviness or peakedness of a probability distribution relative to a reference distribution.
- frequency tableA frequency table tabulates the number of observations in each category or combination of categorical values.
- tidyrtidyr is an R package for reshaping and tidying tabular data.
- data integrityData integrity is the accuracy, consistency, completeness, and validity of data throughout its collection and processing.
- descriptive statisticsSummary statistics are numerical descriptions that condense a dataset's main characteristics, such as location, spread, or frequency.
- runnerrunner is an R package that provides functions for running calculations and analyzing values over sequential windows or streaks.
- skewSkewness is the asymmetry of a probability distribution around its center.
- AICThe Akaike information criterion is a model-selection score that balances goodness of fit against model complexity, with lower values generally preferred among comparable models.
- geom_smooth() functionThe ggplot2 geom_smooth() function adds a smoothed trend or fitted-model layer to a plot.
- recode() functionThe car recode() function replaces values in a vector according to specified recoding rules.
- sliceThe dplyr slice() function selects rows from a tabular object by their positions, including positions computed within groups.
- ylim() functionThe ylim() function specifies or constrains the y-axis limits of a plot.
- streakA streak is a sequence of consecutive events sharing a specified outcome or property.
- streak_run() functionThe streak_run() function computes the lengths of consecutive runs of equal or otherwise defined sequential elements.
- efficiencyEfficiency is the amount of player salary expenditure associated with each regular season win.
- scatter plotA scatterplot displays observations as points positioned by the values of two variables, or by one variable against an index or sequence.
- mean absolute deviationMean absolute deviation is the average of the absolute differences between observations and a chosen center, commonly the mean.
- heat mapA heat map is a diagram that encodes data values with colors or shades arranged across a two-dimensional layout.
- centering operationThe centering method transforms values by subtracting a reference center, typically the variable's mean, without necessarily scaling their dispersion.
- operations researchOperations research is the analytical discipline of using mathematical models and optimization methods to support decisions under constraints.
- colnames() functionThe colnames() function in R gets or sets the column names of a matrix-like object such as a data frame.
- conditional probabilityConditional probability is the probability of an event given that a specified condition or other event holds.
- logical typeA logical data type represents Boolean values such as TRUE, FALSE, and missing values in R.
- integrity checkA data integrity check is a validation procedure that verifies that data satisfy expected structural, logical, correctness, and consistency conditions.
- objective functionAn objective function is the mathematical function or criterion that an optimization procedure seeks to minimize or maximize.
- treetree is an R package for fitting and analyzing classification and regression tree models.
- tree() functionThe tree() function from the R tree package fits a classification or regression tree from formula and data inputs.
- championshipA league champion is a team that wins the championship of its professional sports league.
- long dataLong format is a tabular arrangement in which repeated measurements are represented as separate rows with variable-identifying columns.
- geom_point() functionThe ggplot2 geom_point() function adds point or marker layers to a plot according to mapped data aesthetics.
- median absolute deviationMedian absolute deviation is a measure of dispersion based on the absolute differences between observations and the median of the data set.
- namespace operatorThe R namespace operator accesses an exported object from a specified package without attaching that package to the search path.
- season-ending classificationA season-ending classification assigns a team to a category based on whether it missed the playoffs, reached the playoffs without winning, or won the championship.
- data.frame() functionThe data.frame() function in base R constructs a data frame from supplied vectors or other compatible column-like objects.
- upper quartileThe upper quartile is the value marking approximately the 75th percentile of an ordered set of observations.
- coefficient of determinationR2, or the coefficient of determination, is the proportion of variation in a response explained by a regression model.
- glance() functionThe glance() function from broom returns a one-row summary of model-level statistics.
- regression coefficientA regression coefficient is a fitted parameter quantifying the change in a response associated with a one-unit change in a predictor while other predictors are held constant.
- tidy() functionThe tidy() function from broom converts a statistical model object into a row-per-term tabular summary containing estimates and related statistics.
- pickA draft pick is a selection opportunity or selected player in a sports player draft, with earlier picks generally offering access to more highly regarded prospects.
- density plotA density plot is a graphical technique that estimates and displays the distribution of a continuous variable as a smooth curve.
- 1-5 segmentA 1-5 segment is the group of players selected with draft picks numbered 1 through 5.
- across() functionThe across() function from dplyr applies a transformation or summary expression across selected columns in a data operation.
- rowSums() functionThe rowSums() function in R computes sums across columns for each row of a compatible numeric object.
- restRest is a period without scheduled games that allows a basketball team or player to recover before competing.
- geom_tile() functionThe ggplot2 geom_tile() function draws rectangular tiles whose position and appearance encode mapped data values.
- melt()The reshape2 melt() function reshapes tabular data into a long format by stacking combinations of variables and their values.
- function argumentA function argument is an input value supplied to a function when it is invoked.
- return valueA return value is the output produced by a function after it runs.
- marginal playerA marginal player is a player designation for someone with fewer than 25 career win shares in this analysis.
- $ operatorThe $ operator in R extracts or subsets a named component, such as a variable, from a data object.
- categorical predictor variableA categorical predictor variable is an explanatory variable whose values identify membership in discrete groups for comparing an outcome.
- notched boxplotA notched boxplot is a boxplot with a narrowed region around the median that visually represents an approximate confidence interval.
- cumsum() functionThe cumsum() function returns the cumulative sums of the elements in a numeric vector.
- square bracketsAn extraction operator is syntax that selects a subset of elements from an R vector, matrix, array, list, or data frame.
- t.test() functionThe t.test() function is a base R function that performs a Student's t-test and reports test statistics and significance information.
- Lc() functionThe Lc() function from the ineq package computes Lorenz-curve statistics for a numeric distribution.
- map_df() functionThe map_df() function from purrr applies a function over inputs and combines the resulting outputs into a data frame.
- purrrpurrr is an R package that provides tools for applying functions iteratively and working with lists and functional programming patterns.
- distinct valueThe unique() function in R returns the distinct elements, rows, or combinations of values in an object.
- points per gamePoints per game is a basketball scoring statistic equal to the average number of points scored by a player in each game.
- pyramid plotA pyramid plot is a visualization that uses mirrored or stacked horizontal bars to compare distributions across ordered categories.
- comparedf() functionThe comparedf() function from arsenal compares two data frames or other data sets and returns a summary of their differences.
- lpSolvelpSolve is an R package that provides functions for solving linear programming and related constrained optimization problems.
- joinA join operation combines rows from two tabular datasets according to matching values in one or more key variables.
- labelA target variable, also called a response, dependent, or output variable, is the outcome a statistical or machine-learning model seeks to predict or explain.
- ggQCggQC is an R package for creating quality-control charts and related statistical process-control graphics with ggplot2.
- geom_density() functionThe ggplot2 geom_density() function computes a smoothed density estimate and draws it as a plot layer.
- probability densityA probability density function describes the relative likelihood density of a continuous random variable across its range.
- quarterA quarter result is the points or win-loss outcome of a basketball game during one regulation quarter.
- aov() functionThe aov() function is a base R function that fits analysis-of-variance models.
- diagnostic plotA diagnostic plot is a graphical display used to evaluate whether a fitted statistical model satisfies key assumptions and adequately represents the data.
- equal variance assumptionThe equal-variance assumption states that the response variance is the same across the groups defined by a categorical predictor.
- nonlinear mappingNonlinearity is the property that a relationship cannot be represented adequately by a straight-line pattern or linear function.
- binary outcomeA binary target variable is an outcome variable restricted to exactly two possible values or categories.
- conditional logicAn if-else rule is a conditional decision rule that selects one result when a condition holds and another result otherwise.
- leaf nodeA terminal node is an endpoint of a decision tree at which a final prediction is assigned and no further split occurs.
- splitA tree split is a rule that partitions observations into child regions according to the value of a predictor.
- d estimateA d estimate is the signed standardized difference between two group means, expressed in standard deviation units.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
