
Explore hands-on statistics and data science with R through an in-depth introduction led by Dr. Jeffrey Heugh Bona, covering fundamentals, scripts, slides, and practical fiscal analyses.
Access comprehensive R materials, including a 10-section zip, via the resources button; master data input, manipulation, modeling, and visualization with ggplot2.
Introduces R and the Crann manual as the authoritative beginner resource, and outlines CRAN portals, installation basics, and the course’s six-folder materials package.
Practice daily with optional exercises that reinforce concepts in R, copy and paste commands into RStudio, and run them to see plots and workspace results.
Explore the open-source R programming language as a three-leg platform for statistical programming, data manipulation, and graphics, covering data input, vectors, objects, data frames, functions, distributions, and base graphics.
Discover CRAN’s physical mirrors, the foundation, and the development core team behind R. Learn how base and thousands of public packages use the GPL open-source license.
Identify R packages through three indexes—date, name, and CRAN task views—then use domain task views like social sciences or clinical trials to find relevant packages.
Discover how the R environment stores variables, objects, and functions. Save the workspace as a binary file and install and load packages with library or require.
Learn how to read data into R using scan and read.table, work with the workspace and vectors, and import SPSS and SAS datasets with the foreign package.
Learn to read data into an R session using read.table and read.csv, supplying file paths and headers to create data frames from space-delimited text, with attention to missing data.
Learn to read comma-separated data in R with read.table, specify the separator and header, handle missing values, and inspect data using dim, str, head, and tail, plus file.choose.
Learn to read delimited data in R with read.table and read.csv, including header and separator settings, and convert SPSS data to a data frame with data.frame = TRUE.
Explore how vectors form the core of R, covering atomic data types (logical, integer, double, complex, character), vectorization, and basic manipulations that underlie other structures.
Define a vector as an ordered, same-type collection and use the assignment operator `<-` to create variables, then compare with `==` element-by-element and observe coercion if mixing types.
Discover how the R interpreter evaluates each line as a separate expression, returning its value. Explore vectors and strings, how operators call functions, and right-to-left assignment, semicolons, and spaces.
Learn how R handles vectors and assignment, including integer and real types, mixed values, and how print, parentheses, and the c function affect vectors.
Explore vector arithmetic in R, learning how scalars multiply each vector element and how element-wise vector multiplication works, including recycling when vectors differ in length.
Explore vector arithmetic in R, handling missing values with NA and applying sum, cumsum, product, and exponentiation to vectors. See how NA propagation affects mean, variance, and elementwise operations.
Explore vector arithmetic in R, handling missing values with na.rm in variance, and mastering sort and order, including reverse options, with a cars dataset example illustrating stopping distance vs speed.
Demonstrates linear regression in R with data frame dollar notation, extracting results with summary, plotting a scatterplot, and sorting data frames while preserving integrity, handling complex numbers and Na values.
Generate regular sequences in R using the sequence and replicate functions, control start, end, and increment, including named arguments and repeating elements.
Understand how logical vectors yield true or false per element when comparing to 13, use which to locate true indices, and apply any, all, and basic logical operators in R.
Explore missing values in R, differentiating NA and NaN, and how is.na and is.nan evaluate values. Examine character vectors and text processing with grep, word cloud, and paste.
Explore index vectors in R by building logical filters to select elements, using negation to invert truth values, and subsetting with ranges, repeats, and mixed indices.
Explore how index vectors and names transform vectors and data frames in R, including accessing elements by name or position, and using is, sample, and abs to manipulate data.
identify how identical compares objects, apply abs to negate values, and see class coercion from numeric to character in R, then grasp by-value object semantics.
Explore how vectors organize the workspace as the default unit, manage objects like B and X, and understand removal, coercion, and automatic attributes.
Work through session 2 exercises to fill in scripts for word problems, explore multiple methods, and identify the shortest solution while extending knowledge of objects, classes, arrays, and matrices.
Practice session 2 exercises in R, applying vectors, c(), diff, and functions like max, mean, min, variance, and standard deviation to analyze data and correct 24 in commute times.
Explore how to work with vectors in R, using equality checks, which for indexing, boolean logic, and calculating counts and percentages, with examples like commute times and phone bills.
Explore vector arithmetic and recycling in R, showing how operations align to the longest vector and boolean indexing selects elements greater than 5 or less than 3 with NA handling.
Explore how R handles objects and classes by assigning values, coercing types between numeric, integer, double, and character, and observing copy-on-modify behavior and basic workspace management.
Explore numeric types in R, including integers, real numbers, and complex numbers. Learn to check with is.numeric, convert with as.numeric, perform arithmetic, and use max, min, and equality vs assignment.
Explore strings in R, coercing strings to numeric when possible, testing types with is numeric and is a character, and using paste for joining and substring for extracting parts.
Explore how factors and ordered factors model categorical data, distinguish nominal and ordinal types, manage factor levels, inspect with levels and tabulate, and handle unexpected factor behavior.
Explore logical vectors and operations, and identify missing data types such as blank cells, NA, NaN, and infinity, and handle them in calculations.
Explore R vectors: index elements, suppress with negative indices, rearrange with indexing, vectorially add scalars, determine length, and use order and boolean indexing to rank and filter.
Vectorization speeds up calculations by applying arithmetic to all vector elements at once, unlike iterative loops. Recycling reuses a shorter vector to extend to longer ones, sometimes with warnings.
Explore core data types in R, including logical, integer, double, complex, and character, and learn how type and mode relate to vectors, using the c function to create vectors.
Explore vectors, matrices, data frames, and lists in R, with emphasis on indexing and naming rows and columns to reference elements and subsets.
Explore data frames as the workhorse of data processing, comparing their two-dimensional structure to spreadsheets, with uniform column types and row observations, and learn how lists enable versatile, heterogeneous outputs.
Understand real numbers, integers, and doubles, why calculations default to real, how casting with as integer or as double works, and how complex and imaginary numbers arise.
Explore complex numbers, vectors, and logical tests in R, using assignment and coercion to reveal how real, numeric, and character objects behave.
Create and manipulate vectors, including character vectors, join elements with paste with or without separators, name vector elements, and build lists with named components to organize data.
Explore R objects by building and indexing lists, vectors, and matrices, explaining single versus double bracket indexing, named components, and coercion rules for mixed types.
Explore a concise web resource called Best first tutorial that emphasizes matrix algebra and key matrix concepts, with scripts and end-of-section exercises for practice.
Coerce a character vector to a factor to expose levels, compare printing behavior, and use substring to extract text; explore vectorized operations and base R text processing.
Examine how character vectors become factors, compare nominal and ordered factors, and see how levels govern insertions and the distinction between never existed and missing data.
Explain how r handles character and factor objects, demonstrating indexing with which, creating a factor f.f with 26 alphabet levels, and printing behavior with noquote, while noting internal level numbering.
Explore factors in R, including converting to factors, managing levels, dropping unused levels with drop = TRUE, and creating ordered factors to represent ordinal data.
Learn how to use tapply and the apply family to compute means by state across matrices, and define user functions to estimate standard error, variance, and standard deviation.
Explore the fundamentals of arrays in R, detailing their multi-dimensional structure, the dimension attribute, and how vectors, matrices, and data frames map to one-, two-, and higher-dimensional arrays.
Explore representing data with arrays and matrices across dimensions, labeling months and years in longitudinal studies. Learn matrix and array functions, dimension names, and recycling when data elements run short.
Explore how arrays become matrices in R, using the matrix function with row and column specs, byrow option, and coercion with as.matrix, is.matrix, and Matrix.
Explore the warp breaks data frame, convert it to a matrix with as Matrix, and examine how types and names affect indexing and coercion rules in R.
Explore indexing in R with natural row and column indexes, selecting elements by position or name, and manipulating vectors, matrices, and three four-by-two matrices with repeats and transposed views.
Learn how matrices in R are built column-wise by default and how indexing returns a matrix. Discover naming rows and columns with dimnames and how to populate matrices by row.
Explore pseudo random number generators and generate Poisson, normal, uniform, and exponential distributions with lambda, visualizing results with histograms.
Explore matrices in R by creating random uniform datasets for simulations, renaming rows and columns with the names function, and computing the mean of each matrix column in part 3.
Explore matrix operations in R, including computing column means and row variances, binding results, labeling columns and rows, and indexing matrices with two-column indices.
Explore how matrices enable design manipulation and matrix algebra, detailing how to populate arrays, respect dimensions, and handle zero, NA, and recycling.
Learn matrix multiplication and named vectors in R, use the matrix operator on named vectors, and employ the outer function for exponentiation and three-way tables.
Explore vectors and matrices as two-dimensional arrays, learn to force dimensions or use matrix(), and see how transpose helps numeric data.
Learn to create and manipulate matrices in R, set seeds for reproducibility, generate Poisson-distributed vectors, and access elements by numeric indices or row and column names.
Discover labeling row and column names, compute means by column and variances with apply family functions, and append these stats to matrices; learn about arrays and indexing.
Explore advanced array functions in R, including creating multi-dimensional arrays, recycling rules for mismatched sizes, and pre-allocating zeros for efficient computations, with examples of the outer product and named vectors.
Explore how the outer product works in R, generating multiplication tables and multi-dimensional arrays using the outer operator, with examples of vectors, recycling, and cbind.
Explore how lists and data frames in R relate, with data frames inheriting from lists and serving as the go-to structure for data analysis, while lists enable recursive, multi-typed components.
Explore how lists in R are heterogeneous and output multiple results from a function. Learn list indexing and slicing, using single and double brackets for subsetting.
Master native list indexing in R by slicing components with single brackets and extracting with double brackets, and treat list components like data frame columns.
Learn how vectors form the building blocks of lists in R, and master accessing list components with single and double brackets, including named lists and the name= syntax.
Access list components by index or name, using double brackets and quotes for named elements, and name components to improve clarity when organizing heterogeneous lists that differ in length.
Explore how list indexing works in R, comparing native brackets, dollar signs, and quoted names, and apply equivalent techniques to data frames for simple, efficient data analysis.
Explore lists, matrices, and vectors in R, compare data frames and indexing semantics, and learn to name components to manage complex list structures.
Learn to add and modify list components in R, handle named and unnamed elements, manage subscript out of bounds errors, and nest matrices, vectors, and data structures inside a list.
Learn how data frames act as a restricted list with named columns and row names, holding vectors, factors, numerics, and even matrices, with rules for coercion and two-dimensional structures.
Explore how cbind and rbind combine vectors and data frames in R, and distinguish between matrices and data frames. Understand type coercion rules and how indexing reveals factor levels.
Explore how a data frame is a list, with equal-length columns and rows. Learn indexing of rows and columns, recycling behavior, and creating matrices and lists from components.
Explore how a matrix can become a fourth component in a data frame, creating new columns like 4.1, 4.2, and 4.3, and how overwriting a component alters rows.
Learn to manipulate data frames in R by selecting, omitting, and sorting rows. The lecture shows reading data with read.table and handling Windows paths in a worms dataset.
Explore how to inspect and access variables in the R workspace and data frames, using ls, the search path, and the $ operator, and understand how attach affects variable lookup.
Explore how attaching data frames can create copies and mask variables across datasets, and master indexing by rows, columns, and conditions to yield vectors or data frames.
Learn to manipulate data frames by selecting rows and noncontiguous columns, distinguish between data frames and vectors, and perform sampling, bootstrapping with replacement, and sorting.
Sort data frames by one or more keys to produce a fully ordered table. Explore primary, secondary, and tertiary sorts, tie handling, and selecting specific columns.
Manipulate data frames by selecting columns with a vector, filtering rows with boolean conditions, and require worm density above the median and soil pH below 5.2.
Learn to manipulate data frames with the cars93 data set from the mass package, including data preparation, installation, loading, attaching, and inspecting with head and str.
Explore data inspection with structure, subset data by rows and columns, and understand sorting by manufacturer; learn how R converts strings to factors and how attach affects the search path.
Explore how attaching datasets in R simplifies referencing variables, learn to detach to avoid conflicts, and master subsetting data frames with logical conditions to filter Chevrolet and Dodge cars.
Learn to sort a data frame in R by mpg city and mpg highway to compare make and model, revealing Geo Metro as the top city mpg.
Learn to index the max price column for mpg city and mpg highway in an R data frame. Compare rows as data frames and columns as vectors to guide solutions.
Learn to reverse data frame rows and columns, randomly select six of eight columns with the sample function, and view the first 10 rows in reverse order using R.
Learn how to sort car data in r by mpg city, maintaining low-to-high order within each manufacturer, using order and reverse, and handling factor variables and dataset misspellings.
Filter car data in r with boolean logic: mpg city >20 and mpg highway >26, select cars with price above the mean, and understand masking when attaching data and packages.
Discover how user defined functions empower automated, repeatable analyses in R, from simple routines to building packages and private libraries that organize shared functionality and datasets.
Learn to define named and user defined functions in R, specify formal arguments and defaults, use the dot-dot-dot, structure the function body, and return the last evaluated value.
Define and call functions, pass vectors or other arguments, and perform a pooled t-test to compare means using two numeric vectors.
Learn to run a two-sample t-test in R with native functions, generate 100 normally distributed observations, and compare the means of male and female data within a single data frame.
Apply the two-sample t-test to compare groups, using a data frame with distinct means and overlapping standard deviations, and explore R functions' evaluation frames, environments, and scope.
Demonstrate how variables are resolved across environments when a function looks up missing values and uses named arguments. Explain formal arguments, assigned variables, and free variables in function definitions.
define functions with default argument values to reduce user burden and prevent errors; use the ... rest argument to pass any number of arguments to inner functions.
Explains the many means function in R, which accepts any number of vectors, computes each mean and variance, returns the results, and uses a list to collect inputs.
Explore how a many means function computes means and variances for multiple vectors via an ellipsis, and how formal, local, and free parameters define function scope.
Trace how R resolves variables across local, parent, and global environments in the comprehensive statistics and data science with R course, illustrating free variables, frames, and nested functions.
Explore lexical scoping in r: how nested functions resolve variables across three environments, contrast with static scoping, and use of super assignments in closures with an open account example.
Explore how super assignment in R pushes variables to the global environment, risking pollution while demonstrating how outer scope updates like total and balance propagate through nested functions.
Explore super assignment in R by modeling accounts for Ross and Robert, with balance, withdraw, and deposit functions inside lists, and managing global state.
Demonstrate how the care plot function uses default plotting character and color, and how both positional and named arguments affect symbol type and color in a scatterplot.
Explore parmax and parmin in R by comparing two vectors pairwise, building a function that returns the median of the pairwise maxima, and learn related coding techniques.
Demonstrate parboth using two vectors x and y to compute medians via parMax and parMin, then return a named list of the results, illustrating function overwriting and multi-value outputs.
Explore named and anonymous functions in R, learn how return statements terminate execution, and see vectorized calculations with x, y, and z in a practical example.
Explore lazy evaluation in R by defining a plot function with a local z-dependent default for y, showing how arguments are evaluated only when needed and affect plots.
This lecture presents exercises for user defined functions in R, demonstrating vectorized operations that raise vector elements to their positions and how to translate stepwise tasks into functions.
Explore user-defined functions in R by implementing tempF1 and tempF2 that operate on vectors of any length, applying powers and index-based division via vectorization, with desk checks.
Define and test a vectorized R function that raises each vector element to its index power, with examples using 1 2 3 and variations.
Explore building a robust user-defined function in R that computes a power-series sum by simple executable steps, using numerators like 1,2,4,8,16 and denominators as 1,2,3,4; test with x=1 and x=2.
Define a vectorized function that computes 3-element moving averages across a numeric vector, returning length n−2 results by summing triplets and dividing by three.
Compare methods to compute a sequence by summing three consecutive elements and dividing by three, using vectorized shortcuts and a looping indexed approach.
Create vectors with c, assign with <- and =, inspect in the console and workspace, and generate Poisson random data with rpois(lambda=0.61), noting different samples.
Create a vector tamps of temperatures, perform vectorized operations like subtracting 32, and convert Fahrenheit to Celsius using 5/9*(tamps-32), while recognizing vectors as the foundational data structure in R.
Compare observed temperatures to baselines by subtracting vectors element-wise, learn how vector length and uneven sizes affect operations, and use r's length and sequence functions with election height data.
Explore indexing vectors and changing elements with assignment, and use the colon operator for sequences across basic structures. Compare user defined functions with plans to create custom functions later.
Compute the mean height, derive height differences, and form a data frame from winner, opponent, and difference vectors; test who is taller and plot a bar plot with base graphics.
Explore bar and scatter plots of election height data, including height differences between winners and opponents, electoral college outcomes, and bar plots versus histograms for frequency distributions.
Compute sample proportions, mean, and variance for death counts, fit a Poisson model with lambda 0.61, compare observed and expected counts, and introduce user-defined function basics.
Define an R function with a single argument to compute the adjusted variance and compare it to the native var function on a temperatures vector, noting likelihood versus unbiased estimates.
Use user-defined and built-in functions for numerical analysis in R, including integrating the beta function, passing functions as arguments, and plotting with curve.
Create a 3×3 matrix from a vector, inspect the beta function integral on [0,1], and learn column-wise data filling, indexing, and naming for matrix-based modeling.
Demonstrates assigning the same names to matrix rows and columns using the gets assignment operator in R, checks row sums, and explores matrix multiplication and iterative generations with apply.
Learn to inspect data frames as spreadsheet-like structures containing 50 state records of per capita arrest rates, using head, dim, names, structure, any, and summary to reveal variables and summaries.
Explore how to subset data frames with subscripts and the dollar sign, then create univariate histograms to visualize a variable's distribution using base hist and the mass package's truehist.
Learn how attaching a data frame moves its variables into the search space for direct reference, and how detaching prevents name conflicts while computing percent of murders with vectorized operations.
Attach and work with data frames in R using with or attach to reference variables, then create scatter plots to explore correlations, like urban population versus murder rate.
Explore how the pairs scatterplot matrix reveals all pairwise correlations among numeric variables, interpret correlation and covariance differences, and learn importing data and R assignment basics.
Create vectors for car mileage by model, bind them into a data frame, and inspect structure to distinguish numeric from factor columns. Use read.table and getwd to manage data files.
Enter data manually and read files with read.table or read.csv in R, handling tab or space delimited data; analyze pi digits with a frequency table and compute proportions and variance.
Compute p-hat and its standard error for a true proportion, using p(1-p)/n and confidence bounds. Compare bar plots to histograms for discrete digits, and cover quantitative and categorical data.
Engage with hands-on R exercises: normal percentiles via the cuniform function, density plots with curve for chi squared and gamma, binomial probabilities and cumulative distributions, and a president-height scatterplot.
Practice solving statistics exercises in R by querying the normal distribution with qnorm for percentiles, exploring the chi squared and gamma densities, and using vectorized functions and help queries.
Learn to overlay plots in R by using the curve function with add equals true, and compute binomial probabilities for x = 0 to 12 with dbinom.
Learn to model probabilities in R using choose, exponentiation, and cumulative sums, compute tail probabilities like eight successes out of 12, and plot and save a winners-versus-losers height plot.
Explore the linear modeling template in R, with y ~ x, intercept options, and the matrix form y = Xβ + ε, plus cautions on transformations and nonnormal errors.
Explore fitting y with quadratic and interaction terms in R, using I() in formulas, and model classification variables, covariates, and factorial designs with main effects and interactions.
Learn how to specify linear models with the formula operator, using plus/minus for terms, intercept control, and tensor nesting for factors A, B, and C.
Analyze differences in mean weight gain across balanced factorial designs via ANOVA, using factors such as protein source and amount in rats.
Explore ANOVA and multivariate analysis of variance applied to skull measurements across a millennium, with two predictive variables and their interaction.
Explore multivariate analysis of variance (manova) with multiple dependent variables, omnibus statistics (including Hotelling) for testing mean vector differences, and pairwise or Tukey adjustments in balanced or unbalanced designs.
Learn to update a fitted ANOVA or regression model in R with update, apply dot notation for transformations like sqrt, and review Lm (OLS) and ANOVA case sensitivity.
Learn to compare nested models with anova, using chi-squared tests and p-values to decide if a more complex model improves prediction, in a balanced 2x2 protein study of weight gain.
Examine variability within each cell, using standard deviation or variance, to interpret mean differences in a two by two ANOVA design and R's aov output.
Learn how to interpret ANOVA with contrasts, sum of squares, and interaction effects using fitted models, summary outputs, and interaction plots in practical R examples.
Explore how unbalanced anova design and the order of introducing explanatory variables alter sums of squares and p-values, affecting main effects and interactions.
This lecture demonstrates using anova with a fitted model, then applies Tukey's method to compare all pairwise differences and identify which contrasts significantly affect litter weight.
Explore linear modeling and regression with one predictor, linking the normally distributed response y to x through the mean mu and estimated beta, while assuming independent, zero-mean, constant-variance errors.
Estimate beta hat by minimizing the sum of squared residuals between observed and predicted y values.
Examine the properties of the estimated coefficient β̂ in linear modeling. Treat β̂ as a random normal variable with mean equal to the true β and discuss unbiasedness.
Examine how repeated samples yield a distribution of beta hats, understand their variance, and estimate sigma squared and the variance of beta using the sum of squares.
demonstrates linear regression through two datasets: estimating universe age from galaxy velocity and distance, and analyzing rainfall from cloud seeding interactions with multiple variables and a suitability criterion.
Explore regression with a linear fit that predicts y from multiple x variables, evaluates residuals, and uses an overall F-test to assess significant coefficients under normal, independent, constant-variance errors.
Apply simple and multiple regression in R with lm, using a formula and data, then regress velocity on distance with the Hubble data.
Create a scatterplot of velocity versus distance to reveal a clear linear relationship, apply ordinary least squares regression, and examine diagnostic plots of residuals.
Examine regression diagnostics with diagnostic plots to assess heteroscedasticity and residuals, identify outliers, and reinforce homoscedasticity concepts in regression scripts (part 3) for R data analysis.
Examine how seeding and echo motion relate to rainfall using box plots and univariate diagnostics, assess outliers, medians, and distribution shapes to interpret covariate effects.
Explore scatterplots of rainfall by time and cloud cover, identify outliers, and fit a six-variable regression model to study how seeding interacts with multiple factors.
Explain how to extract regression results from a fitted lm object using summary, inspect residuals and predicted values, and evaluate coefficients and goodness-of-fit with r-squared and f-statistics.
Plot data to reveal an interaction between seeding and rainfall, noting that low SNB values indicate greater seeding suitability. Assess residuals and normality with fitted-versus-residuals plots and a Q-Q line.
Explore residual diagnostics with plots, including the Q-Q line, to assess zero mean, homoscedasticity, and outliers. Examine studentized and standardized residuals, leverage, and Cookes distance to identify influential observations.
Explore linear modeling with R by using warpbreaks and cars datasets to test interactions, fit models with speed and a squared term, and compare model performance.
Extend linear models to generalized linear models to handle non normal responses like proportions, counts, binary, and survival data, using glm with a suitable family, such as normal or Poisson.
Explore generalized linear models and how error variance relates to mean for counts and proportions, binomial and gamma cases, and linear predictor with link functions like logistic, log, and exponential.
Understand how the link function transforms the linear predictor into a predictive value for y, and how reversing this transformation enables interpreting coefficients in GLMs with canonical links.
Explore how generalized linear models handle different data types, including binomial proportions and counts, using logit and log links, and evaluate models via residual deviance and degrees of freedom.
Explore GLMs for proportion data using odds ratios and a logit link, showing binomial variance as P times Q and linking the log(P/Q) to a linear predictor.
Explore glms and how they handle non-constant variance with binomial data, using CK enzyme levels to predict heart attack probability and illustrating weighted regressions.
Examine a binomial glm analyzing esr status (<20 healthy, >20 unhealthy) using fibrinogen as predictor, with real data, conditional density plots, and binomial link in R.
Fibrinogen levels significantly predict health status from ESR rate, with each unit increase raising the odds of being non-healthy by sixfold; globulin adds no predictive gain.
Compare two fitted GLM models for ESR using anova chi-square test to favor the simpler model; bubble plots show fibrinogen strongly predicts ESR, globulin is weaker, Breno gene aligns.
Model aggregated counts of agreement with the statement that women should run homes, with men running the country, using a binomial generalized linear model with education and gender as predictors.
Perform a GLM analysis of womens' role in society, showing education level significantly affects agreement, noting dispersion and deviance, with male and female s-shaped curves predicting responses.
Explore education as an interaction with gender in a GLM, revealing a significant female education effect and a distinct gender-by-education interaction, with predictions showing women's responses vary by education level.
Examine a small GLM study of colon polyp counts with two treatments and age, highlighting overdispersion and switching from Poisson to quasi-poisson for reliable inferences.
Explore glm analysis of colonic polyps, where treatment remains significant while age loses significance, and learn how to interpret the difference between the two drug treatments using t values.
Discover how generalized additive models and smoothers extend regression and enable path modeling, contrasting a global linear fit with local minimization over portions of the predictor variable.
Learn how locally weighted smoothing uses a span to follow residuals and data, often with a 50 percent window, and how GAMs extend this with polynomial degrees.
Explore how smoothing spans influence fit in Olympic running times, comparing 20%, 30%, and 40% spans to reveal how shorter windows follow data more closely and how fits differ.
Explore scatterplots with outliers, compare linear, quadratic, and cubic fits, and evaluate GAMs for forecasting future times using confidence intervals and ANOVA-driven model comparisons.
Use spline-based nonlinear fits to quantify how age in months, number of vertebrae operated, and starting vertebra position influence the probability of correcting the condition.
Explore base graphics in R by loading a dataset in the studio, plotting two variables with cartesian and formula notation, and understanding when to use or avoid attaching datasets.
Compare ggplot graphics to base R plotting using quick plot, color and label options, and add regression lines; learn to plot two datasets on one graph and manage axis scaling.
scale axes for two data sets by building a plotting frame, setting x and y ranges with range, plotting red and blue points, adding regression lines, and placing the legend.
Merge two datasets with different column names by standardizing names and tagging as A or B, then bind them. Create a layered plot with regression lines and confidence intervals.
Sequence nested loops to draw 30 plots with different plotting characters, labels, and text, demonstrating character expansion and read table usage on a sleep deprivation reaction-time dataset.
Create unique subject numbers, merge datasets, and plot reaction time by subject using plotting characters and colors with bw plots to reveal patterns.
Explore base graphics fundamentals, compare them to grammar of graphics representations like ggplot, and preview lattice graphics (trellised plots) through hands-on scripting and annotated scatterplots.
Compare base graphics and ggplot2 in R, and learn to place and size text labels, color points by median, and create new variables for richer plots.
Read a map data set, convert town names from factor to character, and plot the map with town labels positioned at coordinates.
Explore adding text to plots in R by building and visualizing maps with qplot, applying coordinate equal scaling, filtering data, and creating curves using base plot functions.
Set up a 0–10 plot, suppress the axes, and frame the plot. Use locator to interactively draw rectangles and arrows, with color options.
build and call a custom function to draw interactive shapes on plots, using endpoints, heads, and a locator to place points with default values.
Override default polygon vertices by clicking five times to create a lavender polygon, and explore colors and labels with a single user defined function in base graphics and ggplot2.
Demonstrates fitting a nonlinear model to fishery recruitment versus stock size using nonlinear least squares in R, plotting observed data with predicted curves and comparing to a theoretical model.
Demonstrates adding nonlinear fits to plots in R, building data frames for predicted and theoretical values, and creating multi-panel visuals of jawbone age versus size with red and blue lines.
Compare four nonlinear fits to jaw growth data by plotting and labeling locally weighted regression (lowess), loess, generalized additive models, and polynomial models, then predict bone size from age.
Apply polynomial transforms in a linear model to generate nonlinear fits, add predicted lines to plots, and visually compare cubic and other fits using endpoints and indices beyond R-squared.
Add nonlinear fits to plots using G.G. plot and Q plot wrappers, with smooths and 95% confidence bounds, GAMs (Simon Wood), and polynomial fits.
Explore box plots of monthly temperature and rainfall by turning month into a factor, using box plots to reveal medians, quantiles, outliers, and non-parametric distributions.
examine box plots with notches to compare medians across clipping levels, where non overlapping notches suggest significant differences; use tapply to compute means and bar plots with confidence intervals.
Analyze biomass by shoot clipping and root clipping treatments using box plots with notches to compare medians, detect potential significant differences, and visualize with bar plots and confidence intervals.
Explore boxplots for comparing factor level means with notches and confidence intervals, reorder factors by mean, and apply analysis of variance with tukey hsd for multiple comparisons. Generate Poisson histograms.
Create and tune histograms for a Poisson dataset, adjust breaks to center bars on whole numbers, examine range 0–7 and the distribution around 0–1, and compare with index plots.
Explore time series plots in base r, including ts.plot for deaths by year (total, male, female) and seasonal patterns and labeled pie charts.
Analyze orchard spray data with a strip chart to compare treatments in a latin square and assess honeybee decline, then explore ozone relations using a pairs plot with smoothing line.
Explore advanced data visualization in R by building and interpreting a six-panel conditioning plot of ozone data, with shingles and panel smooths, using lattice graphics and ggplot equivalents.
Explore how shingles and coplots reveal the ozone–wind relationship across temperature ranges using panel plots and locally weighted least squares, then examine interaction plots from a split block design.
Demonstrates a box and wiskers plot and a trellised Lavis design plot to study growth rate and its means and standard deviations across water, Daphnia, detergent, and river.
Explore how nitrogen and potassium fertilizer interact with irrigation to affect yield using interaction plots and trellis graphics, with xy plots and box plots and factorial anova.
Calculate effect sizes with the trellised effects graph in the R effects package, using ANOVA to explore interactions among Daphnia, detergent, and river on growth rate.
This course, The Comprehensive Statistics and Data Science with R Course, is mostly based on the authoritative documentation in the online "An Introduction to R" manual produced with each new R release by the Comprehensive R Archive Network (CRAN) development core team. These are the people who actually write, test, produce and release the R code to the general public by way of the CRAN mirrors. It is a rich and detailed 10-session course which covers much of the content in the contemporary 105-page CRAN manual. The ten sessions follow the outline in the An Introduction to R online manual and specifically instruct with respect to the following user topics:
1. Introduction to R; Inputting data into R
2. Simple manipulation of numbers and vectors
3. Objects, their modes and attributes
4. Arrays and matrices
5. Lists and data frames
6. Writing user-defined functions
7. Working with R as a statistical environment
8. Statistical models and formulae; ANOVA and regression
9. GLMs and GAMs
10. Creating statistical and other visualizations with R
It is a comprehensive and decidedly "hands-on" course. You are taught how to actually use R and R script to create everything that you see on-screen in the course videos. Everything is included with the course materials: all software; slides; R scripts; data sets; exercises and solutions; in fact, everything that you see utilized in any of the 200+ course videos are included with the downloadable course materials.
The course is structured for both the novice R user, as well as for the more experienced R user who seeks a refresher course in the benefits, tools and capabilities that exist in R as a software suite appropriate for statistical analysis and manipulation. The first half of the course is suited for novice R users and guides one through "hands-on" practice to master the input and output of data, as well as all of the major and important objects and data structures that are used within the R environment. The second half of the course is a detailed "hands-on" transcript for using R for statistical analysis including detailed data-driven examples of ANOVA, regression, and generalized linear and additive models. Finally, the course concludes with a multitude of "hands-on" instructional videos on how to create elegant and elaborate statistical (and other) graphics visualizations using both the base and gglot visualization packages in R.
The course is very useful for any quantitative analysis professional who wishes to "come up to speed" on the use of R quickly. It would also be useful for any graduate student or college or university faculty member who also seeks to master these data analysis skills using the popular R package.