Question: 1. This problem works with the Chilean voting data as in chilean voting.r where the data matrix is x. The age variable can be simplified

1. This problem works with the Chilean voting data as in chilean

voting.r where the data matrix is x. The age variable can be simplified to retain only the decade of the person by using

x[,5] = floor(x[,5]/10)

(a) Using this simplification, create a 3-dimensional table on age, education and vote. Show your code and

your output.

(b) Using this table create a Bayes classifier to predict the voting status of a person given their decade and

education level. You can represent your classifier as we have done in class. That is, as a table where

the rows account for all possible configurations of the decade and education variables, giving the vote

classification for each.

(c) How would the Bayes classifier classify a female, post-secondary-educated person from the SA region in

her 50s?

(d) Expalin your degree of confidence in this classification and why you believe this.

(e) Estimate the prior distribution on the vote (Y or N) using the data.

(f) Separately for both the Yes and No voters, estimate the class-conditional distributions for gender, education, region, and age. For instance, for gender you would need to compute four probabilities:

P(F |Y es),P(M | Yes),P(F | No),P(M | No)

(g) How would the naive Bayes classifier classify a female, post-secondary-educated person from the SA region

in her 50s? Show the calculations clearly.

The Chilean data is already imbeded into R. Otherwise the alternative link is- https://socialsciences.mcmaster.ca/jfox/Books/Applied-Regression-3E/datasets/Chile.txt

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!