That's not how qqline() works. The line is drawn with respect to a 
_reference_distribution_ which is the normal distribution by default. For the 
binomial distribution, you need to specify the distribution argument. There is 
an example in the help page that shows you how this is done for qchisq(). for 
qbinom() it is:


set.seed(123)
qqplot(rbinom(n=100, size=100, p=0.05), 
       rbinom(n=100, size=100, p=0.05) )
 
qqline(rbinom(n=100,size=100,p=.05),
       distribution = function(probs) { qbinom(probs, size=100, prob=0.05) },
       col = "red",
       lwd = 0.5)




B.


> On Apr 17, 2017, at 9:15 AM, Ashim Kapoor <ashimkap...@gmail.com> wrote:
> 
> 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.gra...@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@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@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]]
> 
> ______________________________________________
> R-help@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@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.

Reply via email to