In: Computer Science
Program this in RStudio
A insurance company is estimating the risk in 250 annual policies. If 10% of the policy holders have at least one claim per year(accident) as usual. What's the probability that more than 12% of 250 has at least one claim?
For answering this question, we have to do two things:
###Assign probability percent to variable##
prob_perc<-0.12
###Save total sample size in variable##
tot<-250
###Calculate the probability by multiplying probability percent
with total##
##sample size##
samp_pop<-(prob_perc*tot)
###Calculate the probabiltiy that atleast 12% of population
has##
##atleast one claim##
##Here samp_pop gives the size of 12% of population(Out of 250
people)
##tot is the size of entire population i.e. 250 people
##0.1 is nothing but the fact that 10% of policy holders have
atleast one claim
till_12<-pbinom(samp_pop,tot,.1)
###Calculate probability that more than 12% of 250 has at least
one claim##
##This is done by subtracting the claim of atleast 12% of
population from the##
##entire data##
atleast_one<-1-(till_12)
##See the output##
atleast_one