In: Math
Your company has been testing two flavors of coffee using free samples, let's call them Flavor A and Flavor B. You are planning to only offer one flavor for sale and are interested in whether your customers prefer Flavor A or Flavor B.
You use a taste testing survey of 60 randomly selected people, and find that 36 people prefer Flavor B.
Using greta and assuming a generative model with Bernoulli data (X) and a Beta prior (θ):
X∼Bernoulli(θ)
Θ∼Beta(2,2)
determine what your updated probability is that Flavor B is preferred to Flavor A. In other words, what percentage of your posterior draws have a theta that is above 0.5?
(Enter answer as a decimal - i.e. 12% would be entered as 0.120. Round to the nearest thousandths place)
Please show me how something like this would be solved using R.