[R] Some coefficients are doubled when I use the step() function

2012-12-09 Thread Chris Beeley
figure out what it could mean. Removing the test=F bit also generates the same behaviour. Any help greatly appreciated. Chris Beeley Institute of Mental Health, UK __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] anova of lme objects (model1, model2) gives different results depending on order of models

2012-06-01 Thread Chris Beeley
Well that's that cleared up then. Thanks to all. Chris B. On 31/05/2012 17:51, Albyn Jones wrote: No, both yield the same result: reject the null hypothesis, which always corresponds to the restricted (smaller) model. albyn On Thu, May 31, 2012 at 12:47:30PM +0100, Chris Beeley wrote: Hello

[R] anova of lme objects (model1, model2) gives different results depending on order of models

2012-05-31 Thread Chris Beeley
to put them in the right order? It just seems like if there were say four models you wouldn't necessarily be able to determine the correct order. Many thanks, Chris Beeley, Institute of Mental Health, UK ...session info follows sessionInfo() R version 2.15.0 (2012-03-30) Platform: i386-pc

[R] Extract fitted values with and without offset from glm

2012-04-05 Thread Chris Beeley
, 14L, 14L, 14L, 14L, 14L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L)), .Names = c(Incident, Numbers), row.names = c(NA, 50L), class = data.frame) Any assistance gratefully recieved. Many thanks, Chris Beeley, Institute of Mental Health, UK __ R

Re: [R] Nested brew call yields Error in .brew.cat(26, 28) : unused argument(s) (26, 28)

2012-04-02 Thread Chris Beeley
this happen to them? If so did you find a solution (other than manually removing the NAs using a final piece of code, which admittedly is not too arduous). Many thanks, Chris Beeley, Institute of Mental Health, UK On 30/03/2012 02:27, Matt Shotwell wrote: On Wed, 2012-03-28 at 11:40 +0100, Chris

[R] Nested brew call yields Error in .brew.cat(26, 28) : unused argument(s) (26, 28)

2012-03-28 Thread Chris Beeley
(drew a blank also from RSiteSearch(Nested brew)) Any help gratefully received. Chris Beeley Institute of Mental Health, UK __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

[R] as.numeric() generates NAs inside an apply call, but fine outside of it

2012-01-09 Thread Chris Beeley
that generates the NAs when as.numeric(mydata[,2]) doesn't and I'm not sure what to do about it in future. I realise I can just loop over the columns, but I would rather get to the bottom of this if I can so I know for future. Thanks in advance for any advice Chris Beeley Institute of Mental Health, UK

Re: [R] as.numeric() generates NAs inside an apply call, but fine outside of it

2012-01-09 Thread Chris Beeley
Perfect, many thanks for explanation and correct line of code. On 09/01/2012 14:29, peter dalgaard wrote: as.data.frame(lapply(mydata, as.numeric)) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] Basic question about re-writing for loop as a function

2011-08-29 Thread Chris Beeley
, 0, 0, 0, 0, 0 (because the fifth value is the only one that contains a 2). Any suggestions gratefully received! Chris Beeley Institute of Mental Health, UK __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] odfWeave repeats output

2011-08-12 Thread Chris Beeley
problem. Using R v2.13 on Windows, v 2.12 on Linux, was using RStudio but just tested it without (just in case) and it does the same thing. Any suggestions gratefully received. Chris Beeley Institute of Mental Health, UK. Output of the operation is below. With this output: odfWeave(/media

[R] Match strings across two differently sized dataframes and copy corresponding row to dataframe

2011-06-30 Thread Chris Beeley
1567 length(comments$ImproveCat[commvec[!is.na(commvec)]]) # yields 1512 I'm sorry, I did try to construct an example dataframe, but ironically I can't make that work either! Sorry! Any help gratefully received. Many thanks! Chris Beeley Institute of Mental Health, UK

[R] Replace selected columns of a dataframe with NA

2011-06-20 Thread Chris Beeley
important, if say I just wanted to replace the odd columns, or something like that. I found this code on the internet too: idx - which(foo80, arr.ind=TRUE) foo[idx[1], idx[2]] - NA But I can't seem to rewrite that either, for the same reason Many thanks! Chris Beeley Institute of Mental Health

[R] Subset command and the : operator

2011-05-27 Thread Chris Beeley
put it somewhere else and don't notice the problem. Many thanks! Chris Beeley Institute of Mental Health __ 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

Re: [R] How to remove rows based on frequency of factor and then difference date scores

2010-08-25 Thread Chris Beeley
Many thanks to you both. I have now filed away for future reference the 2 factor tapply as well as the extremely useful looking plyr library. And the code worked beautifully :-) On 24 Aug 2010, at 19:47, Abhijit Dasgupta, PhD aikidasgu...@gmail.com wrote: The paste-y argument is my usual

[R] How to remove rows based on frequency of factor and then difference date scores

2010-08-24 Thread Chris Beeley
of fiddling I have had to admit defeat. I would be very grateful for any words of advice. Many thanks, Chris Beeley, Institute of Mental Health, UK __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Odp: Problem with aggregating data across time points

2010-07-03 Thread Chris Beeley
advice. Many thanks, Chris Beeley (Institute of Mental Health, UK) structure(list(Location = structure(c(1L, 2L, 2L, 1L, 3L, 5L, 5L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 4L, 4L, 1L, 5L, 5L, 5L, 5L, 6L, 1L, 2L, 3L, 5L, 6L, 6L, 6L, 7L, 7L, 5L, 5L, 4L, 4L, 4L, 3L, 3L, 3L, 2L, 2L, 2L, 2L, 7L, 7L, 7L

[R] Problem with aggregating data across time points

2010-07-02 Thread Chris Beeley
, then 23-5-2008 0 0 0 0 again, and etc. I've had several abortive attempts and done some Googling but have got nowhere. I'd greatly appreciate any advice. Many thanks, Chris Beeley (Institute of Mental Health, UK) structure(list(Location = structure(c(1L, 2L, 2L, 1L, 3L, 5L, 5L, 1L, 1L, 2L, 2L, 2L, 3L