Re: [R] ordering boxplots according to median

2006-03-22 Thread John Wilkinson (pipex)
Use reorder # boxplot with increasing order of medians s2-with(InsectSprays,reorder(spray,count,median)) with(InsectSprays,boxplot(count~s2)) # boxplot with decreasing order of medians s2-with(InsectSprays,reorder(spray,-count,median)) with(InsectSprays,boxplot(count~s2)) John

Re: [R] How to find statistics like that.

2005-11-11 Thread John Wilkinson \(pipex\)
Adai, I recently came across the following definition of a statistic which may be relevent to the discussion. John - Beran’s (2003) provocative definition of statistics as “the study of algorithms for data analysis” elevates computational considerations to the forefront of the field. It is

Re: [R] Extracting Variance Components

2005-10-27 Thread John Wilkinson \(pipex\)
Mike, use --- VarCorr(lme.object) or for a user friendly output use varcomp from the 'ape' package-- require(ape) varcomp(lme.object) varcomp also allows scaling of components to unity (*100 gives %) and also allows for cumulative sum of components. Note. varcomp doesn't work for lmer

Re: [R] lme and lmer syntax

2005-10-26 Thread John Wilkinson \(pipex\)
Ronaldo, According to Douglas Bates's paper in 'R' News, It would seem that the correct model for nested split plot random effects with lmer , in your example ,with x2 nested within x1, would be -- lmer(y~x1 + x2 +(1|x1)+(1|x1:x2)) Try it with your model any see how it compares with your aov

Re: [R] Subsetting a list

2005-10-19 Thread John Wilkinson \(pipex\)
Dennis Try TEST[-3] [[1]] [1] A1 A2 [[2]] [1] B1 B2 for removing more than one element from the list (say 2 3) -- TEST[-c(2,3)] [[1]] [1] A1 A2 HTH John Dennis Fisher wrote--- Colleagues, I have created a list in the following manner: TEST- list(c(A1, A2), c(B1, B2),

Re: [R] Sorting a data frame by one of the variables

2005-10-16 Thread John Wilkinson \(pipex\)
Leaf, using your example data as 'dat' below -- dat-read.table(clipboard,header=T) dat XYZ 1 22.0 24.0 4.3 2 2.3 3.4 5.3 3 57.2 23.4 34.0 #to order the data frame by say X (for column 1)-- dat1-dat[order(dat[,1]),] dat1 XYZ 2 2.3 3.4 5.3 1 22.0 24.0 4.3 3

Re: [R] Doubt about nested aov output

2005-09-07 Thread John Wilkinson \(pipex\)
Ronaldo , It looks as though you have specified you model incorrectly. In the Rats example ,the Treatment is the only fixed effect,Rat and Liver are random effects In aov testing for sig of 'Means' of Random Effects is pointless and that is why 'p' values are not given.Further more the

[R] FW: Re: Doubt about nested aov output

2005-09-07 Thread John Wilkinson \(pipex\)
778.78 33.00 18.335 4.419e-06 *** which agrees with the aov model below. model - aov(Glycogen~Treatment+Error(Rat/Liver)) summary(model) John -Original Message- From: John Wilkinson (pipex) [mailto:[EMAIL PROTECTED] Sent

[R] stepAIC invalid scope argument

2005-08-16 Thread John Wilkinson \(pipex\)
Adai, The following works.Perhaps you should define your 'upper' and 'lower' in the list as aov's, as you have done with your lo,hi and mid. John stepAIC( mid, scope=list(upper = mid , lower = lo) ) Start: AIC= -594.66 y ~ x2 + x3 Df Sum of Sq RSS AIC - x21 0.11

Re: [R] plot question

2005-07-03 Thread John Wilkinson \(pipex\)
a.d. I refer you to ?title and its given examples. try this -- plot(rnorm(10),rnorm(10),xlab= ,ylab= ) title(xlab=year, ylab=expression(paste('M x'*10^{3},)),font=2) note that 'title()' will alos accept a list for x and y labs, for additional parameters,e.g., 'col' and 'cex' John a.d

Re: [R] plot question

2005-07-03 Thread John Wilkinson \(pipex\)
Gabor, I thought that I had worked around the 'expression' format problem, but if the x-y labels are to be bold, then using,say, cex.lab=1.25in the title(), appears to simulate 'bold' font very well, both for the ylab maths expression and xlab text. Your solution is the rigorous one! John

[R] Re Components of variance

2005-06-26 Thread John Wilkinson \(pipex\)
John, In addition to 'VarCorr(nlme) and VarCorr(Matrix)', you could also try 'varcomp' function in the 'ape' package.This requires an 'lme' class of file, from the 'nlme package as input.It additionally gives the options to scale the components by normalizing them (both cumulatively and in

Re: [R] extracting components of a list

2005-06-14 Thread John Wilkinson \(pipex\)
Dimitris, wouldn't this be more precise --- sapply(jj,function(x) which(x$b[1]==4)) [[1]] [1] 1 [[2]] numeric(0) [[3]] [1] 1 John Dimitris wrote --- maybe something like this: jj - list(list(a = 1, b = 4:7), list(a = 5, b = 3:6), list(a = 10, b = 4:5)) ### jj[sapply(jj,

[R] identify label format problem

2005-06-13 Thread John Wilkinson \(pipex\)
Hi , I am attempting to format the 'identify' function labels. I can format the colour but the 'cex' parameter appears not to work for me. example-- x-1:5 y-1:5 plot(x,y) identify(x,y,cex=0.5,col=2) [1] 3 The label is coloured red but the 'cex=0.5' does not reduce the label size. Why

[R] two line plot title with expression problem

2005-02-25 Thread John Wilkinson (pipex)
Dear R-users, I am having a problem formatting a two line plot title with the first line text and the second line an expression. I can’t get the second line expression to line up with the first by starting at the LHS of the line. A simple example illustrates the situation.