All,
How does one specify a model in lmer such that say the random effect for
the intercept has a different variance per treatment group?
Thus, in the model equation, we'd have say b_ij represent the random
effect
for patient j in treatment group i, with variance depending on i, i.e,
. Zagmutt [mailto:[EMAIL PROTECTED]
Sent: Friday, July 06, 2007 6:40 PM
To: Afshartous, David
Cc: r-help@stat.math.ethz.ch
Subject: Re: maintaining specified factor contrasts when subsetting in
lmer
See ?relevel
Regards,
Francisco
Afshartous, David wrote:
All,
I'm using lmer for some repeated
All,
I'm using lmer for some repeated measures data and have specified
the contrasts for a time factor such that say time 3 is the base. This
works fine. However, when
I next use the subset argument to remove the last two time values, the
output indicates that
the specified contrast is not
All,
Is there an efficient way to apply say mean or median to a dataframe
according to say all combinations of two variables in the dataframe?
Below is a simple example and the outline of a manual solution that
will work but is not very efficient
(could also generalize this to a function).
All,
When specifying colors to xyplot w/ a groups argument, using
auto.key no longer maintains the colors properly. I've searched
the docs and help but haven't found exactly what I need ... I saw
a few examples in the archives involving par.settings but that doesn't
seem to do it. I also saw
All,
Is there one liner way to obtain the max per observation for two
vectors?
I looked at apply and lapply but it seems that groundwork would have to
be done before applying either of those. The code below does it but
seems
like overkill.
Thanks!
Dave
x = rnorm(10)
y = rnorm(10)
ind =
thanks all. yes, pmax(x,y) gets it straight away. sorry for missing
this
when I checked the docs.
-Original Message-
From: Greg Snow [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 28, 2007 5:26 PM
To: Afshartous, David; r-help@stat.math.ethz.ch
Subject: RE: [R] applying max
All,
Is there are a simple way to plot multiple xyplots on the same page
in the code below (it currently overwrites the first plot w/ the
second).
I searched the archives and saw a similar question but the answer didn't
seem to work.
thanks
dave
x1 = rnorm(10)
x2 = rnorm (10)
y1 = rnorm(10)
y2 =
-Original Message-
From: Chuck Cleland [mailto:[EMAIL PROTECTED]
Sent: Friday, October 06, 2006 5:32 AM
To: Afshartous, David
Subject: Re: [R] treatment effect at specific time point within
mixedeffects model
Afshartous, David wrote:
The data structure is a repeated measures
+ factor(time)3 + DrugP +
factor(time)3:drugP
I'm surprised this isn't simple or maybe I'm missing something
competely.
thanks
dave
-Original Message-
From: Spencer Graves [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 04, 2006 7:11 PM
To: Afshartous, David
Cc: r-help@stat.math.ethz.ch
, does anyone know why this occurs?
I apologize if my explanation above is confusing, I've tried to make it
as clear as possible.
thanks again,
dave
-Original Message-
From: Doran, Harold [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 05, 2006 11:40 AM
To: Afshartous, David; Spencer
All,
The code below is for a pseudo dataset of repeated measures on patients
where there is also a treatment factor called drug. Time is treated
as categorical.
What code is necessary to test for a treatment effect at a single time
point,
e.g., time = 3? Does the answer matter if the
-Original Message-
From: X.H Chen [mailto:[EMAIL PROTECTED]
Sent: Saturday, September 23, 2006 6:25 PM
To: Afshartous, David; r-help@stat.math.ethz.ch
Subject: RE: [R] plotting grouped data object
I don't get your meaning in what is in datagrp, anyway, try:
X11()
par(new=T)
before calling:
plot
thanks!
-Original Message-
From: Deepayan Sarkar [mailto:[EMAIL PROTECTED]
Sent: Monday, September 25, 2006 1:34 PM
To: Afshartous, David
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] plotting grouped data object
On 9/23/06, Afshartous, David [EMAIL PROTECTED] wrote:
All,
I'd like
All,
I'd like to plot the main relationship of a grouped data
object for all levels of a factor in a single panel.
The sample code below creates a separate panel for each level
of the factor. I realize that this could be done in other ways,
but I'd like to do it via plotting the grouped data
All,
I have a question RE plotting the prediction lines of a random effects
model via augPred. I'll illustrate via the Pixel dataset within the
nlme package:
library(nlme)
attach(Pixel)
fm1Pixel = lme(pixel ~ day + I(day^2), data = Pixel, random = list(Dog =
~ 1))
plot(augPred(fm1Pixel)) ###
All,
When I take a subset of a factor the reduced factor still maintains all
the original levels of the factor when say forming the key in a plot.
The data is correct, but the variable still remembers the original
levels. See below for reproducible code. Does anyone know how to fix
this?
, David
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] levels of factor when subsetting the factor
Afshartous, David [EMAIL PROTECTED] writes:
All,
When I take a subset of a factor the reduced factor still maintains
all the original levels of the factor when say forming the key in a plot
[mailto:[EMAIL PROTECTED]
Sent: Monday, September 11, 2006 2:52 AM
To: Afshartous, David; r-help@stat.math.ethz.ch
Subject: Re: [R] augPred plot in nlme library
Hi
please try not to hide an information
plot(augPred(fm2c))
Error in log(distance) : object distance not found
Is it what you have got
me know and I'll send it directly.
-Original Message-
From: Andrew Robinson [mailto:[EMAIL PROTECTED]
Sent: Friday, September 08, 2006 5:46 PM
To: Afshartous, David
Cc: Deepayan Sarkar; r-help@stat.math.ethz.ch
Subject: Re: [R] augPred plot in nlme library
Hi David,
this is the sort
, control=contr)
plot(augPred(fm2c))
-Original Message-
From: Deepayan Sarkar [mailto:[EMAIL PROTECTED]
Sent: Saturday, September 09, 2006 11:46 AM
To: Afshartous, David
Cc: Andrew Robinson; r-help@stat.math.ethz.ch
Subject: Re: [R] augPred plot in nlme library
On 9/9/06, Afshartous, David
model. Does anyone know how to make sure that augPred plots
the same model as that specified in the model (as below)?
cheers,
dave
From: Afshartous, David
Sent: Thursday, September 07, 2006 6:18 PM
To: r-help@stat.math.ethz.ch
Cc: Afshartous, David
Subject
(fm3comp))
Possibly augPred behaves differently in R than in S, but reading the R
help and
trying various other approaches has not solved this.
Thanks!
Dave
-Original Message-
From: Deepayan Sarkar [mailto:[EMAIL PROTECTED]
Sent: Friday, September 08, 2006 4:37 PM
To: Afshartous, David
Cc
All,
I'm trying to create an augPred plot in the nlme library, similar to the
plot on
p.43 of Pinheiro Bates (Mixed Effects Models in S and S-Plus) for
their Pixel data.
My data structure is the same as the example but I still get the error
msg below.
comp.adj.UKV - groupedData(adj.UKV ~
All,
I have a repeated measures data frame and was wondering if the
covariance matrix can be
calculated via some created indexing or built-in R function.
Specifically, say there are 3 variables, where potassium concentration
is measured 6 times on each patient.
Patient number (discrete)
Time
All,
When plotting a group data object, is there a way to have the plots
of all the groups collapsed onto one plot, i.e., instead of
separate panels as would be produced from example below?
grouped.data.example - groupedData(Y ~ Time | Patient_no,
data = example.frm)
sent this to the list yesterday but didn't see it listed in the daily
summary ... apologies if you receive it
twice ...
From: Afshartous, David
Sent: Tuesday, June 27, 2006 10:02 AM
To: 'r-help@stat.math.ethz.ch'
Subject: sapply question
All:
I'm trying
) {
r[i] = 2*U[i]
}
r ## results for each patient
}
)
result
}
-Original Message-
From: Liaw, Andy [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 28, 2006 10:23 AM
To: Afshartous, David; r-help@stat.math.ethz.ch
Subject: RE: [R
:15 PM
To: Afshartous, David; r-help@stat.math.ethz.ch
Subject: RE: [R] sapply question
Here's an example, using a data frame with two variables plus a grouping
factor:
(dat - data.frame(x1=1:10, x2=10:1, g=gl(2, 5)))
x1 x2 g
1 1 10 1
2 2 9 1
3 3 8 1
4 4 7 1
5 5 6 1
6 6 5 2
7
All,
Simple question but I don't seem to be able to find the answer in the
documentation:
When using plot within a loop, is there any way to supply the argument
to main dynamically,
i.e., so that the title is Patient k below as the loop cycles through
each value of k?
plot(x,y, xlim=c(0,250),
creatine.function.new()
### The names are the concatenation of the patient and the observation
## e.g. patient 24 observation 6 is labeled 246.
-Original Message-
From: Martin Henry H. Stevens [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 15, 2006 7:00 AM
To: Afshartous, David
Cc: r-help
All,
In the function below I have 24 individuals and 6 calculations per
individual.
The 6 calculations are collected each time in a 1:24 loop when
calculating delta.
I'd like to collect all 144 = 24*6 calculations in one vector
(delta.patient.comb).
The function works as is via indexing, but is
. Stevens [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 14, 2006 1:23 PM
To: Afshartous, David
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] appending
Hi David,
It would be helpful if you supply a little data, upon which this would
operate.
Hank
On Jun 14, 2006, at 12:31 PM, Afshartous, David wrote
All,
When starting R, how does one prevent the loading the previous
workspace which was saved? I'd like to start a new project
and save the new image in a different directory, but I'd like to
partition this from the old project. Does there exist a better
way than just deleting the files
All,
I've written some functions that use a list and a
list of sub-lists and I'm running into memory problems,
even after changing memory.limit. Does it make
any difference to the handling of memory if I use
simple vectors and matrices instead of the list and
list of sub-lists? I suspect
All,
Usually when I save a variable I have ascii = FALSE since I usually
load the variable via the load(variable) command and do not need to
view the variable outside of R.
When I set ascii = TRUE and view the variable outside of R in a text editor,
I notice additional characters (starting w/
All,
In the help for memory.size, there is:
Details:
Command-line flag '--max-mem-size' sets the maximum value of
obtainable memory (including a very small amount of housekeeping
overhead).
How does one implement a command-line flag in order to set the max for memory?
cheers,
-Original Message-
From: Spencer Graves [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 11, 2005 9:05 PM
To: Afshartous, David
Cc: r-help@stat.math.ethz.ch; [EMAIL PROTECTED]
Subject: Re: [R] symbol print-name too long
Have you received a reply or otherwise resolved this issue
All,
Is there are a wildcard in R for varible names as in unix? For example,
rm(results*)
to remove all variable or function names that begin w/ results?
cheers,
Dave
ps - please respond directly to [EMAIL PROTECTED]
All,
I'm having a problem selecting directly from a vector. I've written ways to do
this
indirectly, but I'd rather do it directly and didn't see this in the manual.
Essentially, I have:
group.label.new
[1] 7 9 6 1 10 4 8 3 2 5
junk
[1] 1 2
group.label.new[junk 8:10]
[1] 7 9
All,
When defining the arguments of a function, is it possible to supply a function
as
an argument? If so, how is this introduced into the function code as well?
For example, in the body of the function I have:
result = function(x)
and I'd like to supply either function.1 or
All,
I've coded a function and it works manually if I copy it line by line into R.
However, when I try to load (copy and paste) the entire function into
R, I get the following error after the listed line of code:
+ N.j.list = lapply(rej.hyp, length)
Error: symbol print-name too long
Does
Hello all,
I have matrices V.i of dimension n.i x n.i, where i = 1, ..., J, and the sum
of n.i equals N. (and n.i ! = n.j)
goal: create one large matrix V, where V has matrices V.i on diagonal.
I create each matrix V.i in a for loop (1 to J), so each time I'd like to
augment V with
Hello all,
X is a list of 20 lists, and each individual list has 65 elements.
Y is a list of 65 elements.
WANT: subtract Y from each of the 20 lists in X.
Here's what I tried and the error messages:
X - rep(Y, 20)
Error in X - rep(Y 20) : non-numeric argument to binary operator
I tried
44 matches
Mail list logo