Re: [R] lattice smooth problem?

2008-07-06 Thread Gavin Simpson
On Sun, 2008-07-06 at 13:52 +0200, Troels Ring wrote:
> Dear friends - I'm on windows, R 2.7.0
> I try again asking if anyone can explain why a single pig of 16 makes so 
> wild swings.
> Warnings are issued, and they are
> 1: pseudoinverse used at 482.1
> 2: neighborhood radius 242.1
> 3: reciprocal condition number  0
> 4: at  360
> 5: radius  14400
> 6: all data on boundary of neighborhood. make span bigger
> 7: There are other near singularities as well. 14400
> 8: pseudoinverse used at 482.1
> 9: neighborhood radius 242.1
> 10: reciprocal condition number  0
> 11: at  360
> 12: radius  14400
> 13: all data on boundary of neighborhood. make span bigger
> 14: There are other near singularities as well. 14400
> 

Did you read the warnings? 6 and 13 both say "make span bigger", and if
one does this:

> xyplot(Na+fit~time|ID,hh,type=c("g","p","smooth"), span = 0.75,
+ auto.key=list(lines=TRUE))

The warnings disappear. The default span is 2/3 which is not big enough
for these data.

HTH

G

> Here is the data and code, ready for copying directly to R
> Best wishes
> Troels
> 
> Na<-c(135,133,131,129,127,126,124,123)
> ID<-c(13,13,13,13,13,13,13,13)
> fit<-c(134.7945,132.9084,131.0848,129.3372,127.5546,125.8162,
> 124.1836,122.6077)
> time<-c(60,120,180,240,300,360,420,480)
> hh<-data.frame(ID=as.factor(ID),Na=Na,fit=fit,time=time)
> library(lattice)
> xyplot(Na+fit~time|ID,hh,type=c("g","p","smooth"),
> auto.key=list(lines=TRUE))
>

__
R-help@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.


[R] lattice smooth problem?

2008-07-06 Thread Troels Ring

Dear friends - I'm on windows, R 2.7.0
I try again asking if anyone can explain why a single pig of 16 makes so 
wild swings.

Warnings are issued, and they are
1: pseudoinverse used at 482.1
2: neighborhood radius 242.1
3: reciprocal condition number  0
4: at  360
5: radius  14400
6: all data on boundary of neighborhood. make span bigger
7: There are other near singularities as well. 14400
8: pseudoinverse used at 482.1
9: neighborhood radius 242.1
10: reciprocal condition number  0
11: at  360
12: radius  14400
13: all data on boundary of neighborhood. make span bigger
14: There are other near singularities as well. 14400

Here is the data and code, ready for copying directly to R
Best wishes
Troels

Na<-c(135,133,131,129,127,126,124,123)
ID<-c(13,13,13,13,13,13,13,13)
fit<-c(134.7945,132.9084,131.0848,129.3372,127.5546,125.8162,
124.1836,122.6077)
time<-c(60,120,180,240,300,360,420,480)
hh<-data.frame(ID=as.factor(ID),Na=Na,fit=fit,time=time)
library(lattice)
xyplot(Na+fit~time|ID,hh,type=c("g","p","smooth"),
auto.key=list(lines=TRUE))

--

Troels Ring - -
Department of nephrology - - 
Aalborg Hospital 9100 Aalborg, Denmark - -

+45 99326629 - -
[EMAIL PROTECTED]

__
R-help@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.


[R] lattice smooth

2008-07-05 Thread Troels Ring

Dear friends - I have a data.frame hh with columns
Na ID fit  time

135 13  134.7945   60
133 13  132.9084  120
131 13  131.0848  180
129 13  129.3372  240
127 13  127.5546  300
126 13  125.8162  360
124 13  124.1836  420
123 13  122.6077  480

When I use lattice
xyplot(Na+fit~time|ID,hh,type=c("smooth","g","p"),
auto.key=list(lines=TRUE))

the curve for Na after time 240 takes some wild swings, and a warning is 
issued


Warning messages:
1: pseudoinverse used at 482.1
2: neighborhood radius 242.1
3: reciprocal condition number  0
4: at  360
5: radius  14400
6: all data on boundary of neighborhood. make span bigger
7: There are other near singularities as well. 14400
8: pseudoinverse used at 482.1
9: neighborhood radius 242.1
10: reciprocal condition number  0
11: at  360
12: radius  14400
13: all data on boundary of neighborhood. make span bigger
14: There are other near singularities as well. 14400

Otherwise for the whole dataset of 16 pigs it works quite OK - but only 
this pig number 13 makes troubles.

I wonder what occurs.
Best wishes
Troels

--

Troels Ring - -
Department of nephrology - - 
Aalborg Hospital 9100 Aalborg, Denmark - -

+45 99326629 - -
[EMAIL PROTECTED]

__
R-help@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.