-
Notifications
You must be signed in to change notification settings - Fork 0
/
Simpsons_Paradox_usingshiny.Rmd
49 lines (31 loc) · 2.42 KB
/
Simpsons_Paradox_usingshiny.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
title: "Explain Simpson's Paradox"
author: "Sandeep Anand"
date: "June 20, 2017"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# TITLE: Using Shiny To Explain Simpson's Paradox
## Link to the App: https://sananand007.shinyapps.io/simpsonsparadox/
### What is Simpson's Paradox
Every Simpson's paradox involves at least three variables:
+ the explained
+ the observed explanatory
+ the lurking explanatory
If the effect of the observed explanatory variable on the explained variable changes directions when you account for the lurking explanatory variable, you've got a Simpson's Paradox.
### Effect that is shown here uses the concept of Bias seen during Admissions at the University of California , Berkley in 1973
In 1973, the University of California-Berkeley was sued for sex discrimination. The numbers looked pretty incriminating: the graduate schools had just accepted 44% of male applicants but only 35% of female applicants. But By Properly Pooling the admissions , by breaking them down into each department , it was seen that The trend was reversed in some cases .
## User Knowledge To be Noted / Notes
The Explaination and the representation is Trivial and novice approach, and used very simple Widgets to explain the effect of Simpson's Paradox .
*I will be trying to improve on this effort with more verions in the future*
- Use of Two Slider inputs , which gives inputs to the graphs
+ The top Slider being for the input to the easy department
+ The bottom Slider being the input to the difficult department
+ There are two Graphs on the top Row, that are reactive to the input sliders
+ The left bar graph represents the change % of Male and Female admits in the easy department with variance of the easy department input slider
+ The right bar graph represents the change % of Male and Female admits in the Hard department with variance of the Hard department input slider
+ The final Bar graph in Green that is the combined bar plot, we see that , the combined plot varies as such:
- **If % Male admitted (easy/Hard) > % Male admitted (easy/Hard) then % Male admitited [Combined (easy+Hard)] can be less than % FeMale admitited [Combined (easy+Hard)]**
- **If % Male admitted (easy/Hard) < % Male admitted (easy/Hard) then % Male admitited [Combined (easy+Hard)] can be greater than % FeMale admitited [Combined (easy+Hard)]**