Re: [R] nlme plot residuals per group

2006-05-10 Thread Spencer Graves
  Your example is not self contained, and I don't know enough to 
replicate it myself, so I can't tell you what caused it or how to fix 
it.  However, I can outline the type of thing I've often done with this 
kind of problem:

  1.  First, can you get the plots you want using examples from the 
book and distributed with the 'nlme' package?  If no, might that provide 
a simple, self-contained example for a refined post?

  2.  If you get the plots you want from one of the standard examples, 
how does your example that doesn't work differ from the published 
example that does?  That comparison might provide the insight you need 
to solve the problem.  If it doesn't, I would then experiment with both 
my example and the published example until I either solved my problem or 
produced a revision of the published example that illustrated my 
problem.  That revised example might then provide the core for a refined 
post.

  3.  However, if it were me, I'd carry it further, making a local copy 
of the appropriate function, using 'debug', and walking through the code 
line by line until I found where it broke.  By the time I've done this, 
I've typically figured out the problem.  To do this, you need to know 
about the 'method' function, plus possibly 'getAnywhere'.

  hope this helps,
  Spencer Graves

Osman Al-Radi wrote:
 dear list:
 
 I used the nlme library according to the great Pinheiro/Bates book, on
 R2.3, WinXp
 
 Lac.lme is an lme object with unbalanced data, group is a factor
 variable with three levels, when I tried to plot the residuals by
 group I got this error msg:
 
 plot(Lac.lme,resid(.,type='p')~fitted(.)|group)
 Error in limits.and.aspect(prepanel.default.xyplot, prepanel = prepanel,  :
 need at least one panel
 
 Also When I try to use the auPred() function I get the follwoing error msg:
 plot(augPred(Lac.lme))
 Error in tapply(as.character(object[[nm]]), groups, FUN[[dClass]]) :
 arguments must have same length
 
 Any suggestions?
 
 Thanks
 
 
 --
 Osman O. Al-Radi, MD, MSc, FRCSC
 Fellow, Cardiovascular Surgery
 The Hospital for Sick Children
 University of Toronto, Canada
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] nlme plot residuals per group

2006-05-07 Thread Osman Al-Radi
dear list:

I used the nlme library according to the great Pinheiro/Bates book, on
R2.3, WinXp

Lac.lme is an lme object with unbalanced data, group is a factor
variable with three levels, when I tried to plot the residuals by
group I got this error msg:

plot(Lac.lme,resid(.,type='p')~fitted(.)|group)
Error in limits.and.aspect(prepanel.default.xyplot, prepanel = prepanel,  :
need at least one panel

Also When I try to use the auPred() function I get the follwoing error msg:
plot(augPred(Lac.lme))
Error in tapply(as.character(object[[nm]]), groups, FUN[[dClass]]) :
arguments must have same length

Any suggestions?

Thanks


--
Osman O. Al-Radi, MD, MSc, FRCSC
Fellow, Cardiovascular Surgery
The Hospital for Sick Children
University of Toronto, Canada

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] nlme plot

2005-07-11 Thread R V
Hello,

I am running this script from Pinheiro  Bates book in R Version 2.1.1 (WinXP).
But, I can't plot Figure 2.3.
What's wrong?


TIA.
Rod.

-
library(nlme)
 names( Orthodont )
[1] distance age  Subject  Sex 
 levels( Orthodont$Sex )
[1] Male   Female
 OrthoFem - Orthodont[ Orthodont$Sex == Female, ]
 
 fm1OrthF - lme( distance ~ age, data = OrthoFem, random = ~ 1 | Subject )
 fm2OrthF - update( fm1OrthF, random = ~ age | Subject )
 orthLRTsim - simulate.lme( fm1OrthF, fm2OrthF, nsim = 1000 )
 plot( orthLRTsim, df = c(1, 2) )# produces Figure 2.3
Error in if ((dfType - as.double(names(x)[1])) == 1) { : 
argument is of length zero
Execution halted

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] nlme plot

2005-07-11 Thread Douglas Bates
On 7/11/05, R V [EMAIL PROTECTED] wrote:
 Hello,
 
 I am running this script from Pinheiro  Bates book in R Version 2.1.1 
 (WinXP).
 But, I can't plot Figure 2.3.
 What's wrong?

There was a change in the way that R handles assignments of names of
components and that affected the construction of this plot. I've
rewritten the plot construction code (the logic in the current version
was bizarre) and will upload a new version of nlme after I test this
out.

By the way, there is a simpler way of reproducing the examples in our book.  Use

source(system.file(scripts/ch02.R, package = nlme))

but don't try that with the current version of the nlme package. 
There is another infelicity (to use Bill Venables' term) that I will
correct.


 
 
 TIA.
 Rod.
 
 -
 library(nlme)
  names( Orthodont )
 [1] distance age  Subject  Sex
  levels( Orthodont$Sex )
 [1] Male   Female
  OrthoFem - Orthodont[ Orthodont$Sex == Female, ]
 
  fm1OrthF - lme( distance ~ age, data = OrthoFem, random = ~ 1 | Subject )
  fm2OrthF - update( fm1OrthF, random = ~ age | Subject )
  orthLRTsim - simulate.lme( fm1OrthF, fm2OrthF, nsim = 1000 )
  plot( orthLRTsim, df = c(1, 2) )# produces Figure 2.3
 Error in if ((dfType - as.double(names(x)[1])) == 1) { :
 argument is of length zero
 Execution halted
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html