I'm investigating whether a federal district court judge's ABA rating (rating given to the judge by the American Bar Association when he/she is nominated) correlates to the rate that his/her opinions are reversed on appeal. My data looks like so:
judge | aba_rating | commission_year | cases_tot | aff_tot | rev_tot | rev_rate_tot |
---|---|---|---|---|---|---|
Judge1 | Well Qualified | 2010 | 272 | 211 | 61 | 0.22426471 |
Judge2 | Not Qualified | 2012 | 279 | 215 | 64 | 0.22939068 |
Judge3 | Qualified | 2002 | 348 | 287 | 61 | 0.17528736 |
Judge4 | Well Qualified | 2015 | 129 | 97 | 32 | 0.24806202 |
Judge5 | Not Qualified | 2019 | 6 | 6 | 0 | 0 |
... | ... | ... | ... | ... | ... | ... |
Here, I believe using ordinary least squares with the simple reversal rate as the outcome would violate basic ordinary least squares assumptions because the variance of the outcome clearly varies based on how many cases the judge has had appealed. (For example, Judge5's reversal rate looks great because he's never been reversed, but he's new to the job and his sample size is so small that I want to weight his reversal rate less.) A weighted regression seems to be the way to go, but I wanted to confirm I am using the weights
argument correctly since I am new to R.
Most all the documentation I could find on weights
related to heteroscedasticity or having to guess how you think the data should be weighted, and those threads used the inverse-variance as the weight. But I don't think any of that applies here, because we know what the weights should be (reversal rates with more total cases should be weighted more).
I am wondering if the below is the way that I should set it up since I know the weights?
model1 <- lm(rev_rate_tot ~ aba_rating, weights = cases_tot)
I found some information (e.g., here) that would indicate I should do it the following way:
model1 <- lm(rev_rate_tot ~ aba_rating, weights = (1/cases_tot))
I can't tell what's going on under the lm()
hood to know if weights = cases_tot
or weights = (1/cases_tot)
is the way to ensure that the reversal rates of judges who have lots of cases appealed are weighted more than judges with fewer cases appeal.
(I know I could also do this with ANOVA/aov()
because I've defined the ABA Ratings as factors, but there are a couple reasons why I don't want to do that right now.)