RTutor: How much less effective are publicly assigned lawyers?

[This article was first published on Economics and R - R posts, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

So far, my main source of information about the US justice system have been tv shows like Suits, or The Good Wife. They suggest that hiring yourself a good lawyer can be quite expensive but may have a big impact on the verdict. But that are tv shows. What can we infer from real world data?

Amanda Agan, Matthew Freedman and Emily Owens study this question in their very interesting article Is Your Lawyer a Lemon? Incentives and Selection in the Public Provision of Criminal Defense (RESTAT, 2019). They collected a comprehensive data set of criminal cases from Bexar County, Texas with many background variables on case characteristics and attorneys.

Defendants either privately hired their own attorneys or the state assigned and paid a private sector attorney for them. In the descriptive statistics we find that defendants with assigned attorneys are roughly 50 percent (18 percentage points) more likely to be convicted as guilty.

Of course there can be different reasons for this difference:

  1. Case characteristics can differ between cases with privately hired and publicly assigned attorneys.

  2. Adverse selection: Assigned attorneys may be less competent on average than privately hired ones.

  3. Mismatch: The match between assigned attorneys and their clients may be worse and therefore yield less successful outcomes.

  4. Moral hazard: E.g. due to a different fee structure assigned attorneys may put less effort or time into a case than if they would be hired privately.

Using the large number of background variables and the fact that many lawyers work both as assigned and privately hired attorneys, the authors are able to distinguish the different reasons to a large extend.

As part of his Master Thesis at Ulm University, Artemij Cadov has generated a very nice RTutor problem set that allows you to replicate this fascinating analysis in an interactive fashion in R.

Here is a screenshot:

Like in previous RTutor problem sets, you can enter free R code in a web based shiny app. The code will be automatically checked and you can get hints how to proceed. In addition you are challenged by many multiple choice quizzes.

You can test the problem set online on shinyapps.io: https://kendamaqq.shinyapps.io/RTutorLawyers/

The free shinyapps.io account is capped at 25 hours total usage time per month. So it may be greyed out when you click at it.

To locally install the problem set, follow the installation guide at the problem set’s Github repository: https://github.com/KendamaQQ/LawyersLemon

If you want to learn more about RTutor, to try out other problem sets, or to create a problem set yourself, take a look at


or at the Github page


To leave a comment for the author, please follow the link and comment on their blog: Economics and R - R posts.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)