[R] 95% Q-Q Plot error message

John Fox jfox at mcmaster.ca
Sun Nov 4 20:59:22 CET 2012


Dear Liang Che,

> -----Original Message-----
> From: liang.che at us.pwc.com [mailto:liang.che at us.pwc.com]
> Sent: Sunday, November 04, 2012 2:12 PM
> To: jfox at mcmaster.ca
> Cc: r-help at r-project.org; 'Sanford Weisberg'
> Subject: RE: [R] 95% Q-Q Plot error message
> 
> Thanks John.
> 
> I have one observation data point with a value that's exactly equal to
> the predicted value, therefore the residual is 0.  Would this be the
> reason you mentioned below?

No. An observation with hat-value (leverage) equal to 1 will necessarily
have a 0 residual, but the converse isn't true.

Are your data a secret? If so, maybe you can make up a suitable example that
you can share and that demonstrates the problem. As I said, we'll do what we
can in the absence of a reproducible example.

John


> 
> 
> 
> 
> 
> 
> From:        "John Fox" <jfox at mcmaster.ca>
> To:        Liang Che/US/TLS/PwC at Americas-US
> Cc:        "'Sanford Weisberg'" <sandy at umn.edu>, <r-help at r-project.org>
> Date:        11/04/2012 02:03 PM
> Subject:        RE: [R] 95% Q-Q Plot error message
> 
> ________________________________
> 
> 
> 
> 
> 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 <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
> <https://stat.ethz.ch/mailman/listinfo/r-help>
> > PLEASE do read the posting guide http://www.R-project.org/posting-
> <http://www.r-project.org/posting->
> > guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> 
> 
> 
> 
> ________________________________
> 
> 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.




More information about the R-help mailing list