Track T33
Python ≡ R
One idea in two dialects and the defaults that differ.
Unit 1Two dialects
Unit 2Default traps
- 3Default traps: standard deviations and quantilesThe same-looking function gives different answers. Learn the two most common cases, where numpy's standard deviation and every package's quantile hide a choice.
- 4Default traps: missing valuesR stops at missing values, pandas skips them, numpy poisons the result, and a regression can quietly drop rows. Know which you are getting.
- 5Default traps: statistical testsscipy's two-sample t test assumes equal variances and R's doesn't. Two more common tests have traps of the same kind. Learn them, and name your options.
Unit 3Modeling defaults
- 6Factors, reference levels and contrastsA categorical predictor becomes numbers before a model sees it. Both languages pick a reference level for you, and changing it changes every coefficient you read.
- 7Type I, II and III sums of squaresSwap two predictors in an unbalanced ANOVA and R's anova() gives a different F. Learn what each type tests, and why generated code always names one.
- 8Intercepts and penaltiesOne Python regression API leaves out the intercept, and scikit-learn's logistic regression is penalized by default. See what each does to your coefficients.
Unit 4Reproducing results
- 9Seeds and shared random streamsThe same seed gives different numbers in Python and R. See why, what the app does about it, and what a seed does and doesn't promise.
- 10When the two engines disagreeA checklist for reconciling two results, in the order that finds the cause fastest, and how to read a known difference.