C9_presentation

Heyang Gong
12/27/2015

Prediction of Democratic or Republican

My shiny app is to predict whether the person is a democratic or republican, click prediction of democratic or republican to see the application. It includes 3 ways of prediction.

  • predict with the person's IQ
  • predict according whether she or he likes Donald Trump
  • predict with the person's age

predict with the person's IQ

The republicans usually have higher IQ, So we predict the person is a republic when he/she has a IQ of 120 otherwise democratic.

id<- function(id1) {
                if (id1==80) {"Democratic"} 
                else {"Republican"}
}
id(120)
[1] "Republican"
# prediction of democratic or republican

predict according whether she or he likes Donald Trump

Republicans are often likes Donald Trump while democratics hate him so much. So we make a prediction on whether the person likes Donald Trump or not.

Here is introduction of Donald Trump

predict with the person's age

Democratics are usuall young idealistic students, or losers who needed the government to be a babysitter. So age is one of predictor for their political believes.

plot of chunk unnamed-chunk-2