Re: [R] Counting occurances of a letter by a factor

2010-09-10 Thread Darin A. England
I fiddled around and found this solution, which is far from elegant, but it doesn't require you to know the factor levels in advance. t <- with(DF, tapply(as.character(X), Y, table)) lapply(t, function(x) table(strsplit(paste(names(x),collapse=""),split=""))) Darin On Fri, Sep 10, 2010 at

Re: [R] extracting random effects from model formula

2010-09-23 Thread Darin A. England
I've found using the arm package to be very useful. require(arm) then use ranef(Full_model) and fixef(Full_model) On Wed, Sep 22, 2010 at 05:39:41PM +1000, Lorenzo Cattarino wrote: > Hi again, > > > > Sorry, probably I was not clear enough. > > > > I was wondering if there is a way in R

Re: [R] Standard Error for difference in predicted probabilities

2010-09-24 Thread Darin A. England
I think you can use the bootstrap to obtain the std error. My attempt for your problem and data is below. I would be interested if anyone can point out a problem with this approach. Darin y=rbinom(100,1,.4) x1=rnorm(100, 3, 2) x2=rbinom(100, 1, .7) diff <- vector(mode="numeric", length=200) for

[R] reorder always returns "ordered"

2010-10-05 Thread Darin A. England
Or at least is seems that way to me. It's not a big problem, but the behavior doesn't match the documentation. (I think r-help is the place to report this. ) > x <- factor(1:5) > x.ro <- reorder(x, rnorm(5)) > is.ordered(x.ro) # should be FALSE according to ?reorder [1] TRUE > > x.ro <- reorder(

Re: [R] reorder always returns "ordered"

2010-10-05 Thread Darin A. England
sion 2.11.1 (2010-05-31) >> i486-pc-linux-gnu >> >>> x <- factor(1:5) >>> x.ro <- reorder(x, rnorm(5)) >>> is.ordered(x.ro) >> [1] FALSE >>> x.ro <- reorder(x, rnorm(5), ordered=FALSE) >>> is.ordered(x.ro) >> [1]

Re: [R] Sample in R

2010-10-19 Thread Darin A. England
No. > ?sample to see what sample() does. On Tue, Oct 19, 2010 at 02:59:05AM -0700, emj83 wrote: > > Hi, > > Please can someone tell me if using sample() in R is actually a quick way of > doing the Inverse Transform Sampling Method? > > Many thanks Emma > -- > View this message in context

Re: [R] varclus in Hmisc vs SAS PROC VARCLUS

2010-11-08 Thread Darin A. England
My impression is that varclus from the Hmisc library is very convenient to use when you want to get an idea of the correlation among predictor variables in a regression setting, but if you want to perform cluster analysis in general, you may be better off using a different function in R, such as hc

Re: [R] Random slopes in lmer

2010-08-26 Thread Darin A. England
coef(mod1)$bird will give you a matrix with two columns. The first column is the intercept for each bird and the second column is the slope for each bird. ranef(mod1) will also give you a matrix of two columns. These represent the random effects. That is, how much the intercept (or slope) is shift

Re: [R] Random slopes in lmer

2010-08-26 Thread Darin A. England
t; Many Thanks > > > > Sam > > > > Dr Samantha Patrick > > EU INTERREG Post Doc > > Davy 618 > > Marine Biology & Ecology Research Centre > > University of Plymouth > > Plymouth > > PL4 8AA > > > > T: 01752 586165 > > M:

Re: [R] R in the NY Times

2009-01-07 Thread Darin A. England
On Wed, Jan 07, 2009 at 08:00:28AM -0600, Frank E Harrell Jr wrote: > This is great to see. It's interesting that SAS Institute feels that > non-peer-reviewed software with hidden implementations of analytic > methods that cannot be reproduced by others should be trusted when > building aircraf

Re: [R] Help with clustering

2009-01-27 Thread Darin A. England
Have you tried using the cosine of the angle between two observations as the similarity measure? If you want to account for magnitudes, there is something called the jaccard coefficient (if I remember correctly) that can be used. Darin On Mon, Jan 26, 2009 at 10:41:40AM +0100, mau...@alice.it wro

Re: [R] How to install R-2.8.1 on AIX

2009-03-14 Thread Darin A. England
Search the R mailing list archive for other reports of success on AIX. I compiled a 64-bit version of R-2.8.0 successfully with the following options: export OBJECT_MODE=64 export CC="xlc_r -q64" export CFLAGS="-O -qstrict" export CXX="xlC_r -q64" export CXXFLAGS="-O -qstrict" export F77="xlf_r -q