Question: outcome- 0, 1, 2, 3, 4, 5 probability- 0.1, 0.2, 0.3, 0.2, 0.1, 0.1 Using the barplot function, make a probability histrogram of the above
outcome- 0, 1, 2, 3, 4, 5
probability- 0.1, 0.2, 0.3, 0.2, 0.1, 0.1
Using the barplot function, make a probability histrogram of the above above probability mass function. Specify the height of the bars with the y variable and the names of the bars (names.arg), that is, the labels on the x axis, with the x variable in your dataframe.
# the data frame
data <- data.frame(outcome = 0:5, probs = c(0.1, 0.2, 0.3, 0.2, 0.1, 0.1))
# make a histogram of the probability distribution
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
