Command Index to Statistical Rethinking

I am having a great time working through Richard McElreath’s text, Statistical Rethinking: A Bayesian Course with Examples in R and Stan.  The focus is on building, testing, interpreting, and improving  statistical models.  It is absolutely empowering and I have begun to build simple models myself.  However, I have been frustrated as I have done so, by the book’s poor index particularly the sparsity of references to R commands.  A case of “I know there is a way to do it, but now I have to page through the book to find it.”  So I took an hour or so and built an index to all (most) of the R commands Dr. McElreath used and supplied with the Rethinking library.  I just finished.  It is very rough and untried and probably has some omissions.  Anyway it is pasted below in case anyone else might find it useful.

Index to Rethinking – Formatted

Posted in Math and Me | Tagged | Leave a comment

FOIL is Verboten

My students and I have a habit of referring to the act of multiplying two binomial forms as FOILing, recalling the acronym FOIL (First, Outer, Inner, Last) for remembering the process.  My excuse for using the term  is that they use it all the time and their excuse is that I use it all the time.  And I really don’t mind using it in class.  They get the point  immediately. However I have officially banned the term from their written work.  “FOIL” doesn’t belong in formal English.  It is imprecise and sounds young.  I think what pushed me over the edge was when I found the term, “reverse FOIL,”  on a student’s paper.

Posted in Classroom Happenings, Pedagogy, Rants, Teaching | Tagged | Leave a comment

Here’s What You Don’t Get to Do

I started last Monday’s Precalculus II class with this little speech(edited).

“Here’s what you don’t get to do.  When you have children, you don’t get to say, “I was bad at math.”  Because you are good at math.  You could be better at math.  You know how. Just work harder. Many people like to ‘brag’ that they are bad at math.  Don’t do that to your kids.  Don’t give them any excuses.  You are good at math.  I know.  I grade your work and answer your good questions.”

Posted in Classroom Happenings, Rants, Teaching | Tagged | Leave a comment

Derooting with Radicals

My students were working in pairs on this problem,

Radical Expression To Be Simplified

Radical Expression To Be Simplified

One group, looking for perfect square factors, had gotten this far,

Radical Expression Simplified So Far

Radical Expression Simplified So Far

One person asked the other, “Now what?”  The other replied, “Just deroot the to the eight and the y to the eight.  The other said, “I get it.” and they got,

Simplified Expression

Simplified Expression

What a great word!  Dare I add “deroot” to the conversation next time we work such a problem?  I think so..

Posted in Classroom Happenings, Cool Ideas, Teaching | Tagged | Leave a comment

PEMDAS Strikes Again

Our pre-calculus class was going over how to combine sums and differences of logarithm expressions into a single logarithm when Steven Orton (He gave  permission to use his name.) asked, “What about PEMDAS?”  PEMDAS is an acronym used for remembering the order of operations of evaluating algebraic expressions.  I muttered a few sentences, said I probably didn’t understand the question, and offered to discuss it after class.

I woke up a 1:30 am the next morning knowing what Steven meant. At the beginning of the next class I warned my students to work left to right when combining logarithms and meet with Steven after class with the following explanation.

First let’s revisit the original issues remembering this codicil to PEMDAS :

Addition/subtraction are on the same hierarchical level of the order of operations and must be worked left to right.  The same holds for multiplication/division.

Here is the issue for addition/subtraction.

Addition-Subtraction Order of Operations

Addition-Subtraction Order of Operations

The final numbers differ.  Our agreement is that the first process, moving left to right,  gives the “correct” answer.  Correct in this context means what we have agreed such expressions should be evaluated left to right since order makes a difference.

Such expressions can be made unambiguous by remembering the definition of subtraction is just adding the opposite.  Thus,

How to "Fix" Addition - Subtraction

How to “Fix” Addition – Subtraction

Now any order of evaluation gives the same result since addition is associative.

The same argument works for multiplication/division.

Multiplication-Division Order of Operations

Multiplication-Division Order of Operations

The first evaluation is “correct” and we can “fix” the issue by remembering that division is just multiplying by the reciprocal.  Thus,

How to "Fix" Multiplication-Division

How to “Fix” Multiplication-Division

Now any order of evaluation gives the same result since multiplication is associative.

Now let’s use the properties of logarithms to simplify the following.

Logarithm Simplification Order of Operations

Logarithm Simplification Order of Operations

Again left to right gives the desired answer.  This can be “fixed” as follows.

How to "Fix" Logarithm Simplification

How to “Fix” Logarithm Simplification

This simplification uses a property of logarithms that we didn’t make explicit in class, namely,

A Property of Logarithms

A Property of Logarithms

We have an interesting application of PEMDAS for simplifying logarithm expressions addressing about both subtraction and division.

All of the above to fix (explain) a defect in standard algebraic expression notation.  Thanks to Steven for the excellent question.

Posted in Classroom Happenings, Curriculum, Teaching | Tagged , | Leave a comment

My Heart Aches

Yesterday I made my heart ache. I took a small action – made a small gesture at least in this day and age.  I can’t talk about it.  My students have an absolute right to privacy. I could have cried.

Posted in Uncategorized | Leave a comment

Rubrics as Data – Part II

I am continuing to study, “What happens when we amalgamate rubric data?”  Part I is here.  This part will consider how to treat rubric data as a sample from a larger population. The same assumptions as in Part I apply: “Questions of accuracy and sampling will be ignored.  Student work will be assumed correctly categorized.  Issues of inter-rater reliability and the like will be assumed solved and simple random samples will be assumed to have been taken.”  I will be using a classical approach and avoid the modern logit and probit orientations which I will leave for Part III.  The statistical package R will be used.

A first question would be “How well does the sample data represent the population?” – a question of confidence intervals. The R function, MultinomialCI, based on a paper by Cristina P. Sison and Joseph Glaz for this sample data,

Summary Rubric Data

Summary Rubric Data

gives these confidence intervals,

Confidence Interval Table

Confidence Interval Table

which are depicted on this chart.

Sample Rubric Data Histogram with Error Bars.

Sample Rubric Data Histogram with Error Bars.


The function treats the data as simply multinomial without using the ordinal aspect of the data.  For such a small sample, n=39, the error is quite large, for instance the rubric data estimates that the student population in the developing category is between 18 and 50 percent.

A second question that could be asked is “How do these students compare to other students?”  First I would like to compare before and after data.  It might be possible to obtain data on the same students at an earlier time.  Here at SOU we compare end of freshman year writing to capstone writing for specific students.  To do this we can use the Wilcoxon Rank Sum test for paired data.  This is a non-parametric statistical test that takes advantage of the data’s ordinal character.  This is the data.

Before and After Rubric Data Table

Before and After Rubric Data Table

Note the added column the improvement, has After score minus Before score calculated.  Using this R command:  wilcox.test(badata$Before,badata$After, paired = TRUE,alternative = “less”) I got a p-value of .00002 which indicates that there was improvement.

Finally, it is possible to compare two populations with sample rubric data.  This can be done with the Wilcoxon Rank-Sum test.  The method essentially ranks all the data and sees if one population has more ranks higher than the other.  This is the R command: wilcox.test(badata$Y2014,badata$Y2015, paired = FALSE,alternative = “less”,na.action = na.omit)  Using this data,

Unpaired Rubric Data

Unpaired Rubric Data

R gave an approximate p-value of .48.  There was no change from 2014 to 2015.

All this is fairly basic and pro forma and leaves out how to discover effects of other variables like gpa or major for example and there are better ways of doing all of it.  I have spent my winter break immersed in Rethinking Statistics by Richard McElreath. This is a wonderful book and opened my eyes to the world of Bayesian modeling. I am attempting to build reliable models for modeling rubric data using the software that comes with the text.  The process has been  exciting and fulfilling.  I will report my progress in Part III of this series.

Posted in Math Explorations, Teaching | Tagged , | Leave a comment