[R] How to compare contours

2006-09-20 Thread Landini Massimiliano
dear All
can anybody point me in to the right direction for this kind of operation??

Here an example.
Please consider an hilly matematical landscapa as

i-1

X- runif(i, min=0, max=4*pi)
Y- runif(i, min=0, max=4*pi)
Z-(cos(X)+cos(Y))/2

plot(X,Y,xlim=c(0,4*pi),ylim=c(0,4*pi), xlab=X,ylab=Y, main=c(i,  points))
coscos.spl-interp.new(X,Y
,Z,xo=seq(0,4*pi,length=100),yo=seq(0,4*pi,length=100))
contour(coscos.spl,add=T,col=blue,levels=c(seq(-1,1,1/5)),labcex=0.8)

in this case contour plot derived from 1 points interpolated rappresent very
welll real trend.
now consider

par(mfrow=c(4,5) )
for (i in seq(5,195,10)) {

X- runif(i, min=0, max=4*pi)
Y- runif(i, min=0, max=4*pi)
Z-(cos(X)+cos(Y))/2

plot(X,Y,xlim=c(0,4*pi),ylim=c(0,4*pi), xlab=X,ylab=Y, main=c(i,  points))
coscos.spl-interp.new(X,Y
,Z,xo=seq(0,4*pi,length=100),yo=seq(0,4*pi,length=100))
contour(coscos.spl,add=T,col=blue,levels=c(seq(-1,1,1/5)),labcex=0.8)
}


How many points are necessary to fit (at 95% c.i.) true surface???
85 points???
or more than  200???

tnx in advance!!



-
Landini Massimiliano
-
Legge di Hanggi: Più stupida è la tua ricerca, più verrà letta e approvata.
Corollario alla Legge di Hanggi: Più importante è la tua ricerca, meno verrà
capita.

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Box-Cox / data transformation question

2005-01-30 Thread Landini Massimiliano
On Tue, 25 Jan 2005 15:42:45 +0100, you wrote:

|=[:o)  Dear R users,
|=[:o)  
|=[:o)  Is it reasonable to transform data (measurements of plant height) to 
the 
|=[:o)  power of 1/4? I´ve used boxcox(response~A*B) and lambda was close to 
0.25.
|=[:o)  

IMHO (I'm far to be a statistician) no. I think that Box Cox procedure must be a
help to people that had none experience in data transforming. In fact data
transforming include other methods that Box Cox procedure can't perform as rank
transformation, arcsine square root percent transformation, hyperbolic inverse
sine, log-log, probit, normit  and logit.
Transformation is not simply an application of a formula to massive data. Is
preferable decide appropriate transformation knowing deepening how and from
where data were collected.


|=[:o)  Regards,
|=[:o)  Christoph
|=[:o)  
|=[:o)  __
|=[:o)  R-help@stat.math.ethz.ch mailing list
|=[:o)  https://stat.ethz.ch/mailman/listinfo/r-help
|=[:o)  PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html



-
Landini dr. Massimiliano
Tel. mob. (+39) 347 140 11 94
Tel./Fax. (+39) 051 762 196
e-mail: numero (dot) primo (at) tele2 (dot) it
-
Legge di Hanggi: Più stupida è la tua ricerca, più verrà letta e approvata.
Corollario alla Legge di Hanggi: Più importante è la tua ricerca, meno verrà
capita.

__
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] statistical test improvement of readability (was average disjunction)

2005-01-24 Thread Landini Massimiliano
Dear all ReadeRs
I was finding a quick method to improve test readability adding or constructing
(with your help) one or more function that allow what follow.

Please consider

Trt-c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5)
Block-c(1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4)
AD2DAT-c(1.44,2.32,1.68,1.28,0.12,0.08,0.24,0.52,0.12,0.08,0.16,0.28,0.16,0.08,0.12,0.12,0.16,0.08,0.32,0.76)
Tab-cbind(Trt,Block,AD2DAT);Tab
AD2DAT.aov.lm-aov(lm(AD2DAT~as.factor(Block)+as.factor(Trt),method=qr))
TukeyHSD(AD2DAT.aov.lm,as.factor(Trt),ordered=TRUE,conf.level=.95)
TukeyHSD(AD2DAT.aov.lm,as.factor(Trt),ordered=TRUE,conf.level=.99)
TabMEANS-aggregate(Tab,list(Trt),FUN=mean);TabMEANS

Group.1 Trt Block   AD2DAT
1   12.5 1.68
22   2.5 0.24
3   3   2.5 0.16
4   4   2.5 0.12
5   5   2.5 0.33

So I'm thinking that was more readable something like one function that permit
me to juxtapose tiny letters when we are talking about .95 confidence level and
capital letters when we are talking about .99 confidence level so results will
be approx this

Group.1 Trt Block   AD2DAT  .95 .99
1   12.5 1.68   a   A
22   2.5 0.24   b   B
3   3   2.5 0.16b   B
4   4   2.5 0.12b   B
5   5   2.5 0.33b   B

Does anyone have suggestion???
Thanks in advance!!




-
Landini dr. Massimiliano
Tel. mob. (+39) 347 140 11 94
Tel./Fax. (+39) 051 762 196
e-mail: numero (dot) primo (at) tele2 (dot) it
-
Legge di Hanggi: Più stupida è la tua ricerca, più verrà letta e approvata.
Corollario alla Legge di Hanggi: Più importante è la tua ricerca, meno verrà
capita.

__
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] Average disjunction

2005-01-21 Thread Landini Massimiliano
Dear All
after performing a test like TukeyHSD is there a simple/complicated way to
perform average disjunction with letter? example

10  aA
6   bA
1.5 cB
2   cB
1   cB

Thanks



-
Landini dr. Massimiliano
Tel. mob. (+39) 347 140 11 94
Tel./Fax. (+39) 051 762 196
e-mail: numero (dot) primo (at) tele2 (dot) it
-
Legge di Hanggi: Più stupida è la tua ricerca, più verrà letta e approvata.
Corollario alla Legge di Hanggi: Più importante è la tua ricerca, meno verrà
capita.

__
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: Re: [R] muliple plots with pairs (matrix of scatter plots)

2004-12-21 Thread Landini Massimiliano
On Tue, 21 Dec 2004 12:47:44 +1300, you wrote:

|=[:o)  Hi
|=[:o)  
|=[:o)  
|=[:o)  Uwe Ligges wrote:
|=[:o)   Tiago R Magalhaes wrote:
|=[:o)   
|=[:o)   I am trying to make a graph with 4 scatter matrixes plots and 
couldn't 
|=[:o)   do it. While trying to find a solution for this I also came across 
the 
|=[:o)   idea of giving different values to the same argument for each of the 
|=[:o)   lower and upper function but couldn't do it. (Examplified below with 
|=[:o)   the col argument). The first problem of plotting 4 scatter matrixes 
in 
|=[:o)   a graph is a problem of real interest for me at this point. The 
second 
|=[:o)   problem is a matter of curiosity.
|=[:o)  
|=[:o)   I am using a Mac PowerBook G4 with OS 10.3.7 and R 2.0.1
|=[:o)  
|=[:o)  
|=[:o)   Problem 1)
|=[:o)   x=data.frame(a=sample(1:100, 50), b=sample(1:100, 
50),c=sample(1:100, 
|=[:o)   50),d=sample(1:100, 50))
|=[:o)   x.list=vector('list',4)
|=[:o)   for (j in 1:4) x.list[[j]]=x
|=[:o)  
|=[:o)   #produces a graph with four plots:
|=[:o)   layout(matrix(c(1,3,2,4),2,2))
|=[:o)   for (j in seq(x)){
|=[:o)   plot(x.list[[j]][1:2])
|=[:o)   }
|=[:o)  
|=[:o)   # But unfortunately the following produces a new plot everytime:
|=[:o)   layout(matrix(c(1,3,2,4),2,2))
|=[:o)   for (j in seq(x)){

par(new=TRUE) 

|=[:o)   pairs(x.list[[j]])
|=[:o)   }
|=[:o)   #Maybe pairs can't be used to produce a graph with multiple plots?
|=[:o)   
|=[:o)   
|=[:o)   Yes, it uses similar constructs to put multiple plots together.
|=[:o)   
|=[:o)   You might want to use packages grid and gridBase to set something up 
|=[:o)   using viewports.
|=[:o)  
|=[:o)  
|=[:o)  
|=[:o)  I don't think that's going to work either -- pairs() makes some pretty 
|=[:o)  strong assumptions that it is the only plot on the page.
|=[:o)  
|=[:o)  One possible way to go is to use splom() instead from the lattice 
|=[:o)  package.  For example (using your data from above) ...
|=[:o)  
|=[:o)  splom(~ x)
|=[:o)  
|=[:o)  ... and lattice plots can be embedded in grid viewports easily, for 
|=[:o)  example ...
|=[:o)  
|=[:o)  grid.newpage()
|=[:o)  pushViewport(viewport(layout=grid.layout(2, 2)))
|=[:o)  for (j in seq(x)) {
|=[:o) row - (j - 1) %/% 2 + 1
|=[:o) col - (j - 1) %% 2 + 1
|=[:o) pushViewport(viewport(layout.pos.col=col,
|=[:o)   layout.pos.row=row))
|=[:o) print(splom(~ x.list[[j]]), newpage=FALSE)
|=[:o) popViewport()
|=[:o)  }
|=[:o)  popViewport()
|=[:o)  
|=[:o)  ... you may need to fiddle with the splom() args to get them looking 
how 
|=[:o)  you want them.
|=[:o)  
|=[:o)  Paul


-
Landini dr. Massimiliano
Tel. mob. (+39) 347 140 11 94
Tel./Fax. (+39) 051 762 196
e-mail: numero (dot) primo (at) tele2 (dot) it
-
Legge di Hanggi: Più stupida è la tua ricerca, più verrà letta e approvata.
Corollario alla Legge di Hanggi: Più importante è la tua ricerca, meno verrà
capita.

__
[EMAIL PROTECTED] 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] Different graph type can coexisti??

2004-12-19 Thread Landini Massimiliano
Please consider a data frame

A   B   C   D
1   4   5   0
2   3   2   75
3   4   1   84
4   5   1   90
5   3   0   100

Is there a way to plot column B and C as barplot *and* D as line on the same
graph??

R-2.0.1 powered by Mandrake 10.1


-
Landini dr. Massimiliano
Tel. mob. (+39) 347 140 11 94
Tel./Fax. (+39) 051 762 196
e-mail: numero (dot) primo (at) tele2 (dot) it
-
Legge di Hanggi: Più stupida è la tua ricerca, più verrà letta e approvata.
Corollario alla Legge di Hanggi: Più importante è la tua ricerca, meno verrà
capita.

__
[EMAIL PROTECTED] 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] Homogeneity of variance tests between more than 2 samples (long)

2004-12-19 Thread Landini Massimiliano
Dear all
a couple of months ago i've found threads regard test that verify AnOVa
assumption on homogeneity of variances.  Prof. Ripley advice LDA / QDA
procedures, many books (and many proprietary programs) advice Hartley's F_max,
Cochran's minimum/maximum variance ratio (only balanced experiments), K^2
Bartlett's test, Levene's test.

Morton B. Brown and  Alan B. Forsythe in a 1974 article wrote about Robust test
for the equality of variances (editet by Journal of the American Statistical
Association Vol. 69, pp.: 364-367) ...the common F-ratio and Bartlett’s test
are very sensitive to the assumption that the underlying populations are from a
Gaussian distribution. When the underlying distributions are nonnormal, these
tests can have an actual size several times larger than their nominal level of
significance

Peter Armitage in  Statistical Methods in Medical Research ( Blackwell
Scientific Publication, 1971, page. 212) ...Bartlett's test maybe is less
useful than it seems; motif are two: first F test is very sensitive to the
nonnormality; second, in samples with few data, true variances must differ in
considerable manner before there is a wise/reasonable probability to obtain
results significant. In other word, even if M/C ratio is NOT significant,
estimated  variances and true variances can differ in substantial manner. If
eventually differences in true variances had weight in further analysis, is more
clever admit differences, even if tests give a non significant result...

So, I'm asking at gurus which is best behaviour, which test they use or teach.

-
Landini dr. Massimiliano
Tel. mob. (+39) 347 140 11 94
Tel./Fax. (+39) 051 762 196
e-mail: numero (dot) primo (at) tele2 (dot) it
-
Legge di Hanggi: Più stupida è la tua ricerca, più verrà letta e approvata.
Corollario alla Legge di Hanggi: Più importante è la tua ricerca, meno verrà
capita.

__
[EMAIL PROTECTED] 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] How compare pre-treatment vs. post-treatment assessments

2004-09-28 Thread Landini Massimiliano
Please consider 

Trt_No  PlotSub metpru_0dat metpru_2dat metpru_7dat
metpru_14dat
1   1   1   9   14  12  5
1   1   2   6   7   6   5
1   1   3   6   15  13  5
1   1   4   10  10  9   10
1   1   5   7   7   8   14
1   1   6   9   10  12  11
1   1   7   6   5   8   9
1   1   8   15  9   13  15
1   1   9   15  7   15  6
1   1   10  14  11  15  7
2   2   1   13  7   9   9
2   2   2   13  8   14  13
2   2   3   15  8   11  7
2   2   4   8   13  11  12
2   2   5   12  10  5   14
2   2   6   8   5   11  7
2   2   7   7   6   5   14
2   2   8   12  14  10  11
2   2   9   5   7   9   6
2   2   10  7   15  14  9
3   3   1   4   14  14  5
3   3   2   4   11  9   12
3   3   3   10  8   9   8
3   3   4   6   12  15  13
3   3   5   9   5   10  11
3   3   6   10  8   9   14
3   3   7   4   14  15  11
3   3   8   11  10  8   15
3   3   9   15  12  9   12
3   3   10  14  12  9   7
4   4   1   11  13  15  8
4   4   2   12  14  5   10
4   4   3   15  14  11  14
4   4   4   12  14  8   10
4   4   5   10  7   5   10
4   4   6   7   12  13  7
4   4   7   12  14  9   11
4   4   8   5   9   15  5
4   4   9   12  13  6   5
4   4   10  9   5   10  6
5   5   1   12  2   2   5
5   5   2   14  11  5   5
5   5   3   14  3   1   3
5   5   4   9   5   5   6
5   5   5   14  3   6   5
5   5   6   7   7   7   6
5   5   7   6   10  6   1
5   5   8   4   7   10  11
5   5   9   8   7   2   1
5   5   10  7   4   8   3
3   6   1   11  11  5   14
3   6   2   5   11  12  13
3   6   3   9   8   15  10
3   6   4   15  14  14  13
3   6   5   14  8   12  14
3   6   6   7   6   7   10
3   6   7   13  8   11  14
3   6   8   5   13  14  5
3   6   9   14  11  5   6
3   6   10  7   10  14  11
2   7   1   11  9   12  6
2   7   2   8   9   9   15
2   7   3   7   11  13  5
2   7   4   4   7   7   10
2   7   5   4   15  14  5
2   7   6   10  5   5   9
2   7   7   7   9   7   6
2   7   8   13  13  12  10
2   7   9   9   11  6   7
2   7   10  8   9   9   7
5   8   1   11  6   9   10
5   8   2   10  8   4   11
5   8   3   6   2   11  8
5   8   4   12  6   8   4
5   8   5   9   11  7   10
5   8   6   7   3   3   9
5   8   7   11  10  8   5
5   8   8   14  6   5   2
5   8   9   13  1   1   2
5   8   10  4   7   5   1
1   9   1   13  15  10  8
1   9   2   13  6   11  8
1   9   3   11  6   6   6
1   9   4   6   10  12  12
1   9   5   5   12  9   10
1   9   6   4   7   14  5
1   9   7   13  15  5   9
1   9   8   10  14  5   8
1   9   9   4   12  9   12
1   9   10  4   12  12  14
4   10  1   9   13  7   13
4   10  2   14  11  12  7
4   10  3   9   9   6   14
4   10  4   11  7   10  5
4   10  5   5   7   6   11
4   10  6   8   8   15  6
4   10  7   15  11  13  5
4