[R] 95% Q-Q Plot error message

John Fox jfox at mcmaster.ca
Sun Nov 4 20:01:45 CET 2012


Dear liang.che,

I'm guessing that this is the qqPlot() function in the car package.

This looks to me to be the combination of two problems: (1) You have at
least one observation in your model for which the leverage (hat-value) is 1.
That could happen, for example, if you have a factor in the model with only
one observation at a particular level. (2) qqPlot() isn't handling that
degenerate situation properly.

Not only did I have to guess that you're using qqPlot() in the car package,
but I had to guess what the problem is. If you read the text from r-help at
the bottom of your message, you'll see that it says, "provide commented,
minimal, self-contained, reproducible code." If you'd like help beyond my
remarks above, you're more likely to get it if you provide the commands and
data for your problem. Of course, we'll take a look at qqPlot() to see
whether it's doing something unreasonable, and fix it if we find a problem.

Best,
 John

-----------------------------------------------
John Fox
Senator McMaster Professor of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada




> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
> On Behalf Of liang.che at us.pwc.com
> Sent: Sunday, November 04, 2012 1:31 PM
> To: r-help at r-project.org
> Subject: [R] 95% Q-Q Plot error message
> 
> Can someone please help with the error message below?
> 
> Warning messages:
> 1: Not plotting observations with leverage one:
> 7
> 2: Not plotting observations with leverage one:
> 7
> > print(qqPlot(fit),envelop=.95);
> Error in model.frame.default(formula = Y ~ X - 1, drop.unused.levels =
> TRUE) :
> variable lengths differ (found for 'X')
> In addition: Warning message:
> In matrix(yhat, n, reps) :
> data length [9] is not a sub-multiple or multiple of the number of rows
> [8]
> 
> Thanks!
> 
> ______________________________________________________________________
> The information transmitted, including any attachments, is intended only
> for the person or entity to which it is addressed and may contain
> confidential and/or privileged material. Any review, retransmission,
> dissemination or other use of, or taking of any action in reliance upon,
> this information by persons or entities other than the intended
> recipient is prohibited, and all liability arising therefrom is
> disclaimed. If you received this in error, please contact the sender and
> delete the material from any computer. PricewaterhouseCoopers LLP is a
> Delaware limited liability partnership.  This communication may come
> from PricewaterhouseCoopers LLP or one of its subsidiaries.
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> 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.




More information about the R-help mailing list