Displaying 20 results from an estimated 3000 matches similar to: "summarizing dataframe at variable/factor levels"
2007 Jul 03
1
xyplot and autokey, maintaining colors specified via "col" in key
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 some people using key instead of auto.key, but
that didn't seem consistent.  Is there a
2012 Nov 29
2
Analysis of Variance
Hi, I am encountering a difficulty I don't understand. Be patient, I'm very
new to analysis of variance.
If I load this data:
example12_7=read.table("http://msemac.redwoods.edu/~darnold/math15/data/chapter12/example12_7.dat",header=TRUE)
The run the oneway.test:
oneway.test(time~drug,data=example12_7,var.equal=TRUE)
I get these results:
data:  time and drug 
F = 4.1881, num
2011 Feb 08
1
Just another pattern matching / indexing question
Hi all, thank you for your patience.
I am dealing with a large dataset detailing patients and medications
Medications are hard to code, as they are (usually) meaningless unless
matched with doses.
I have a dataframe with vectors (Drug1, Drug2..... Drug 16) and individual
patients are represented by rows.
The vectors are actually factors, with 100s of possible levels (all the
drugs the patient
2008 Jul 04
1
Repeated measures lme or anova
Hi
As I can't find an example of my data structure I'd like some advice on which is the most appropriate test for significant effects.  If I should be using either lme or anova, is the relevant example below the best/correct way to do the test?
The Data...
2 groups of patients (5 in GroupA, 7 in GroupB)
3 short acting drugs, (I'm not concerned with residual effects from the previous
2011 Sep 28
1
number of items to replace is not a multiple of replacement length
Please help with this error message 
drugbook is an 885 x 32 dataframe
 >names(drugbook)
[1] "DRUG1"      "DRUG2"      "DRUG3"      "DRUG4"      "DRUG5"     
 [6] "DRUG6"      "DRUG7"      "DRUG8"      "DRUG9"      "DRUG10"    
[11] "DRUG11"     "DRUG12"    
2011 Jun 10
1
ggplot2 avoid automatic color selection
Hey all,
I'm trying to replicate some plots with ggplot2. The problem is that I
need to specify the color for every
attribute (drug). If I use the code below the colors get automatically
assigned but I need to plot drug1 in black drug2 in blue
etc.
How do I do that?
q = qplot(days,vol,data = cellLine7064, color = drug, geom = c("line", "point"))
best regards,
Immanuel
2007 Sep 12
1
stastistical test on normalized data
Dear R-maillit,
I have to perform a stastistical test to asses if two grug show the same or different effect on my prepartion.
I tested on the same preparation only one drug and I have to use normalized data due to high variability in the control condictions.
What type can I use? 
A non paramatric test right?
And how can do it on R software?
Thanks in advance
Simone
	[[alternative HTML version
2011 Mar 25
4
two plots in qplot
Hello
I simply want to plot two variables against one 'year' variable in
qplot.
Is any way of doing this without reshaping data in long format and using
facet function afterwards?
Thank you
Denis
2006 Oct 05
2
treatment effect at specific time point within mixedeffects model
Hi David:
In looking at your original post it is a bit difficult to ascertain
exactly what your null hypothesis was. That is, you want to assess
whether there is a treatment effect at time 3, but compared to what. I
think your second post clears this up. You should refer to pages 224-
225 of Pinhiero and Bates for your answer. This shows how to specify
contrasts.
> -----Original Message-----
2012 Nov 09
1
R function data variable name argument
Hello fellow R-ers,
I have spent some time on this and it is driving me NUTS! I am sure there is a solution, so please help.
I am trying to create a function that will plot different lines for subsets of a dataset. For example, I am trying to look at different drug groups (drug2), let's say 1,2,3,4, and 5. The data has 2 different rates, college students and high school students (var names cs
2003 Mar 13
0
Repeated measures 2-way anova -- robustness question
I'm a journalist, wondering what questions to ask about a study that
contrasted the impact on serum cholesterol of two drugs.  This was a
40 dog study: 5 treatment blocks of 4 dogs each, randomized to: a
control block, two blocks at different doses of drug1 and two at
corresponding doses of drug2.  Analysis was 2-factor repeated measures
ANOVA on treatment group and sampling time.  Linear
2006 Sep 26
2
treatment effect at specific time point within mixed effects model
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 design is a crossover
design,
i.e, each patient received drug and placebo?
Finally, what would
2013 Feb 17
2
nested random factor using lme produces errors
Hi,
I am running a mixed-effect model with a nested-random effect. I am
interested in gut parasites in moose. I has three different type of
treatment that I applied to moose which are from different "families". My
response variable is gut parasites and the factors are moose families which
is nested within treatment. My data is balanced.
To answer this question, I used the lme function
2008 Jun 26
3
Connecting lines across missing data points, xyplot
All,
I have data across 5 time points that I am graphing via xyplot, along with
error bars.  For one of the variables I have missing data for two of the
time points.  The code below is okay but I can't seem to get the lines to
connect across the missing time points.  Does anyone now how to rectify
this?
Cheers,
David Afshartous
library(lattice)
## the data 
junk = data.frame(
Visit =
2008 Feb 05
1
Extracting level-1 variance from lmer()
All,
How does one extract the level-1 variance from a model fit via lmer()?
In the code below the level-2 variance component may be obtained via
subscripting, but what about the level-1 variance, viz., the 3.215072 term?
(actually this term  squared)  Didn't see anything in the archives on this.
Cheers,
David
> fm <- lmer( dv ~ time.num*drug + (1 | Patient.new),  data=dat.new )
2008 Jun 16
1
aggregate() function, strange behavior for augmented data
All,
I'm re-running some analysis that has been augmented with additional data.
When I use the exact same code for the augmented data, the behavior of the
aggregate function is very strange, viz., one of the resulting variables is
now coded as a factor while it was coded as numeric for the original data.
Unfortunately, I cannot provide a reproducible code example since it only
seems to occur
2008 Jul 02
1
auto.key in xyplot in conjunction with panel.text
All,
I can't seem to get auto.key to work properly in an xyplot that is employing
panel.text.  Specifically, I often change the default grouping colors then
use auto.key accordingly, but for some reason the same functionality isn't
working for this different type of plot.  Any help much appreciated.
Cheers, 
David
library("lattice")
dat = data.frame( Y = c(rnorm(18,1),
2008 Sep 11
1
plot of all.effects object
All, 
I'm trying to plot an all.effects() object, as shown in the help for
all.effects and also Crawley's R book (p.178, 2007). The data has a repeated
measures structure, but I'm using all.effects for the simple lm() fit here.
Below is a reproducible example that yields the error message.
fm.ex = lm(dv ~ time.num*drug*X, data = dat.new)
fm.effects = all.effects(fm.ex, xlevels =
2007 Jul 06
1
maintaining specified factor contrasts when subsetting in lmer
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 maintained (see below).   I can solve this
by creating a new dataframe
for the subset of interest
2012 May 08
1
coxph data format
Dear List,
Here is an example of survival data in counting process format
(detailed record of each day)
> data[data$Id == 11,]
# extracted one person's record
    Id Event Fup Start Stop sex Drug1
601 11     0   6     0    1   0     0
602 11     0   6     1    2   0     0
603 11     0   6     2    3   0     0
604 11     0   6     3    4   0     0
605 11     0   6     4    5   0     1
606