[R] [nlme] How to calculate standard error of random effects in lme

2011-10-07 Thread Marcus Drescher
Hi all, is there a way to calculate standard error of random effect from the estimated model in lme? Best Marcus [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] Lattice: xyplot group title format

2010-11-09 Thread Marcus Drescher
Dear all, if I plot a lattice xyplot like: library(lattice); require(stats); Depth <- equal.count(quakes$depth, number=8, overlap=.1) xyplot(lat ~ long | Depth, data = quakes) How can I manipulate the group title format (here: Depth)? Like the font size, position, etc. Best Marcus

[R] Several lattice plots on one page

2010-11-08 Thread Marcus Drescher
Dear all, I am trying (!!!) to generate pdfs that have 8 plots on one page: df = data.frame( day = c(1,2,3,4), var1 = c(1,2,3,4), var2 = c(100,200,300,4000), var3 = c(10,20,300,4), var4 = c(10,2,3,4000), var5 = c(10,20,30,40),

Re: [R] Count values in a dataframe with respect to groups

2010-10-08 Thread Marcus Drescher
, Oct 8, 2010 at 11:28 AM, Marcus Drescher wrote: Dear all, I am looking for a function to count values belonging to a class within a dataframe (and ignore NAs). grp = c(1,1,1, 1,2, 2,2) val = c(2,1,5,NA,3,NA,1) dta = data.frame(grp=grp, val=val) The result should look like: grp count  1    3  2

Re: [R] Count values in a dataframe with respect to groups

2010-10-08 Thread Marcus Drescher
Thanks! It works great. One more question: how would I have to set the formula if I would have the columns to count (val1 and val2)? Betreff: Re: [R] Count values in a dataframe with respect to groups Try this: aggregate(val ~ grp, dta, length) On Fri, Oct 8, 2010 at 11:28 AM, Marcus

[R] Count values in a dataframe with respect to groups

2010-10-08 Thread Marcus Drescher
Dear all, I am looking for a function to count values belonging to a class within a dataframe (and ignore NAs). grp = c(1,1,1, 1,2, 2,2) val = c(2,1,5,NA,3,NA,1) dta = data.frame(grp=grp, val=val) The result should look like: grp count 13 22 At the moment, I am trying to find a fun

[R] Several Lattice plots in one Plot

2010-09-30 Thread Marcus Drescher
Hi all, I've been trying for hours, but I do not find a Solution. I want to plot 12 variables over time in separate diagrams in one plot/window using lattice. Two columns, six rows. I used print with the split command, but the graphics are getting really small. Can someone please help me. Foll

[R] How to calc ratios base on current and previous row?

2010-08-27 Thread Marcus Drescher
Hi all, I want to calculate in each row a ratio based on number in the current row and the previous row. Is there a way to do this without for-loops because that is extremely slow. A B [1] 2 2 [2] 2 3 [3] 4 5,5 ... B2 = A2 + 0.5*B

[R] Means from selected columns in a data frame

2010-07-20 Thread Marcus Drescher
Hi all, I have a dataframe with survey data. Now I want to calculate means from several but not all columns (e.g. a1, a2, a3) and save them in a new separate column (e.g. a). Like: a = mean(a1, a2, a3) Can someone help me or give me the right key word to look for? Thanks [[alternativ