Dear All, set.seed(123) qqplot(rbinom(n=100,size=100,p=.05), rbinom(n=100,size=100,p=.05) ) I expect to see 1 clear line,but I don't. What am I misunderstanding? Best Regards, Ashim [[alternative HTML version deleted]]
On 2017-04-17 7:58 AM, Ashim Kapoor wrote:> Dear All, > > set.seed(123) > qqplot(rbinom(n=100,size=100,p=.05), rbinom(n=100,size=100,p=.05) ) > > I expect to see 1 clear line,but I don't. What am I misunderstanding?The distribution is discrete, and points are superimposed. Try the following: set.seed(123) qqplot(jitter(rbinom(n=100,size=100,p=.05)), jitter(rbinom(n=100,size=100,p=.05) )) Spencer Graves> > Best Regards, > Ashim > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Dear Spencer, Okay. Many thanks. My next query is how do I use qqline? When I try> qqline(rbinom(n=100,size=100,p=.05))I don't get the line in the right place. Best Regards, Ashim On Mon, Apr 17, 2017 at 6:31 PM, Spencer Graves < spencer.graves at effectivedefense.org> wrote:> > > On 2017-04-17 7:58 AM, Ashim Kapoor wrote: > >> Dear All, >> >> set.seed(123) >> qqplot(rbinom(n=100,size=100,p=.05), rbinom(n=100,size=100,p=.05) ) >> >> I expect to see 1 clear line,but I don't. What am I misunderstanding? >> > > > The distribution is discrete, and points are superimposed. Try the > following: > > > set.seed(123) > qqplot(jitter(rbinom(n=100,size=100,p=.05)), > jitter(rbinom(n=100,size=100,p=.05) )) > > > Spencer Graves > >> >> Best Regards, >> Ashim >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide http://www.R-project.org/posti >> ng-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posti > ng-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
Moreover, setting the seed once, then evaluating two functions means you are sampling from the same distributions, but you do in fact have different values. Outliers in the rarefied tails of the distribution may lie quite considerably off the expected diagonal. Try set.seed(123) qqplot(rbinom(n=1000, size=1000, p=0.05), rbinom(n=1000, size=1000, p=0.05)) and you will find that you approximate the "1 clear line" quite well - for most of the values. B.> On Apr 17, 2017, at 9:01 AM, Spencer Graves <spencer.graves at effectivedefense.org> wrote: > > > > On 2017-04-17 7:58 AM, Ashim Kapoor wrote: >> Dear All, >> >> set.seed(123) >> qqplot(rbinom(n=100,size=100,p=.05), rbinom(n=100,size=100,p=.05) ) >> >> I expect to see 1 clear line,but I don't. What am I misunderstanding? > > > The distribution is discrete, and points are superimposed. Try the following: > > > set.seed(123) > qqplot(jitter(rbinom(n=100,size=100,p=.05)), > jitter(rbinom(n=100,size=100,p=.05) )) > > > Spencer Graves >> >> Best Regards, >> Ashim >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.