Question

How do I make my graphs show positive numbers? The binomial answers are all positive, but the graphs keep showing a negative.

24 20 21 # R- Code Probability Distribution 22 x <- seq(0,4, by = 1) 23 dbinom(0,4,0.6) 25 dbinom(1,4,0.6) 26 dbinom (2,4,0.6> dbinom (0,4,0.6) [1] 0.0256 > dbinom (1,4,0.6) [1] 0.1536 > dbinom (2,4,0.6) [1] 0.3456 > dbinom (3,4,0.6) [1] 0.3456 > dbiPolitical Races Political Races 0.4 0.4 0.3 0.3 0.2 probability density function 0.2 0.1 0.1 0.0 0.0 -0.346 -0.346 Probabilit

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Correct Code is :

shadeDist(xshade=0,ddist="dbinom",parm1 = 4,parm2=0.6,
          xlab="Probability democrats win 0",main="Political Races")


shadeDist(xshade=1,ddist="dbinom",parm1 = 4,parm2=0.6,
          xlab="Probability democrats win 1",main="Political Races")



shadeDist(xshade=2,ddist="dbinom",parm1 = 4,parm2=0.6,
          xlab="Probability democrats win 2",main="Political Races")



shadeDist(xshade=3,ddist="dbinom",parm1 = 4,parm2=0.6,
          xlab="Probability democrats win 3",main="Political Races")


shadeDist(xshade=4,ddist="dbinom",parm1 = 4,parm2=0.6,
          xlab="Probability democrats win 4",main="Political Races")

You have to understand the arguments used by the function shapeDist .

The Main Arguments are :

ddist : Where you have to specify which distrubution you want to draw the pdf if , here it is dbinom . You have to input as a character , thus "dbinom" .

parm1 and parm 2 are the two parameters of the distribution , here n and p respectively .

xshade : The point where you want to start/end shading .

** In your code , as you have put wrong arguments , by default R chose "dnorm" in ddist argument thus showing negative value and a symmetric Normal distribution .

Add a comment
Know the answer?
Add Answer to:
How do I make my graphs show positive numbers? The binomial answers are all positive, but...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT