Generate a simulated data set with 100 observations based on the following model. Each data point...

90.2K

Verified Solution

Question

Basic Math

Generate a simulated data set with 100 observations based on thefollowing model. Each data point is a vector Z= (X, Y) where Xdescribes the age of a machine New, FiveYearsOld, and TenYearsOldand Y describes whether the quality of output from the machineNormal or Abnormal. The probabilities of a machine being in thethree states are

P(X = New) = 1/4

P(X = FiveYearsOld) = 1/3

P(X = TenYearsOld) = 5/12

The probabilities of Normal output conditioned are machine ageare

P(Y = Normal | X= New) = 8/10

P(Y = Normal | X= FiveYearsOld) = 8/10

P(Y = Normal | X= TenYearsOld) = 4/10

Your data should consist of two vectors Y and Z both of whichare of class character. Convert these to factors using theas.factor function. Analyze your simulated data using thechisq.test function with inputs x=x, y=y. Perform the analysis withthe exact same function, but with simulated p-values using theinputs x=x, y=y, simulate.p.values=TRUE, B=10000. Would you trustthe p-values from the asymptotic distribution or the simulatedp-values more? What conclusions can you draw about your simulateddata from this analysis?

Answer & Explanation Solved by verified expert
3.9 Ratings (583 Votes)
    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students