Reputation: 21
Plot a histogram showing the theoretical distribution of a binomial random variable X with n = 10 and p = 0.5, labeling your plot. The following command might be helpful after assigning d with dbinom
:
gf_line(d ~ 0:10)
I have no idea where to start with this question.
Upvotes: 1
Views: 288
Reputation: 78927
Edit: Thank to jay.sf (see comment)
x=0:10
y <- dbinom(x,10,0.5)
plot(x,y, type='h')
Upvotes: 1