Displaying 20 results from an estimated 10000 matches similar to: "looking for something like "ave" I can pass non numeric to"
2003 Aug 27
1
trying to produce an array of ranks
OK, I am try to produce an array of ranks. I have a set of data (s)
that looks like this
rt subj
312 dave
467 dave
411 dave
383 kim
398 kim
...
Now I want to make a column that is an array of the ranks of rt by
subject. The closest of gotten is using the following.
r <- by (s, s$subj, function(d) rank(d[1]))
This gets the data out with ranks but I cannot figure out how to easily
2007 May 17
2
repeated measures regression
How does one go about doing a repeated measure regression? The
documentation I have on it (Lorch & Myers 1990) says to use linear /
(subj x linear) to get your F. However, if I put subject into glm or
lm I can't get back a straight error term because it assumes
(rightly) that subject is a nominal predictor of some sort.
In looking at LME it seems like it just does the right thing
2002 Nov 28
0
looking for help on repeated measure ANOVA
I am new to R, therefore this might be a naive question, sorry in
advance for that.
I have data on 4 groups of mice (#of subjects: 8,8,8,9) where the
first group is the control group and 2-4 are 3 doses of a
neuro-inhibitor. For each mouse we measured the exploration time of a
familiar and a new object (thus repeated measure design), and I want
to test whether there are different exploration
2003 Aug 22
2
a pickle with ranks and reals?
I predicted that y would increase as x increased. However, I only made
the prediction on the ranks of the scores. The ranks don't correlate
with predicted. And, I don't think a regression on the ranks is
warranted. However, the actual scores do yield a significant slope for
b, and a significant R^2 using a linear regression (y is the value and
x is the predicted rank). What
1998 Mar 13
1
R-beta: New user - looking for help with ANOVA
Hi
I've just installed R on our Sun kit in the lab and on my Linux box at home.
My statistical expertise is not advanced - I have completed Open
University probability and statistics courses, and been using
Gary Perlmans !STAT package for analyses of variance, descriptive
stats, linear regression, non-parametric stats etc for 10 years or so.
(so be gentle with me :-) )
However, R is
2009 Feb 15
2
Fast ave for sorted data?
Hi,
This is probably really obvious, by I can't seem to find anything on it.
Is there a fast version of ave for when the data is already sorted in
terms of the factor, or if the breaks are already known?
Basically, I have:
X = 0.1, 0.2, 0.32, 0.32, 0.4, 0.56, 0.56, 0.7...
Y = 223, 434, 343, 544, 231.... etc
of the same, admittedly large length.
Now note that some of the values of X are
2007 Nov 13
1
TRUNCATED error with data frame
Hi ,
I am new to R.
I am trying to run a simple R script as shown below:
aov.R
------
data1<-c(49,47,46,47,48,47,41,46,43,47,46,45,48,46,47,45,49,44,44,45,42,45,45,40
,49,46,47,45,49,45,41,43,44,46,45,40,45,43,44,45,48,46,40,45,40,45,47,40)
matrix(data1, ncol= 4, dimnames = list(paste("subj", 1:12),
c("Shape1.Color1",
"Shape2.Color1", "Shape1.Color2",
2007 Nov 16
0
Odp: R: ave and quantile
Hi
Patrick Hausmann <c18g at uni-bremen.de> napsal dne 15.11.2007 18:59:06:
> Hello Petr,
>
> one question solved, the next is standing in front of me... If you
> have a minute to look .... great!
>
> > x
> V1 V2 F1
> 1 A 2 0.1552277
> 2 A 3 0.1552277
> 3 A 4 0.1552277
> 4 B 3 0.8447723
> 5 B 2 0.8447723
> 6 C 6 0.2500000
2009 Apr 15
0
ave returns wrong type
I've been using the ave function to compute some statistics on a
data frame. After a while I noticed that, for some reason, it was
returning numerical statistics as strings instead of numbers. I delved
into the code of the functions and traced the problem to the following
fact:
ave uses split<- to do its work. Specifically, it does "split(x,
g) <- lapply(split(x, g),
2008 Dec 05
1
lme4, error in mer_finalize(ans)
Using lmer() on my data results in an error. The problem,
I think, is my model specification. However, lm() works
ok.
I recreated this error with a more simple dataset. (See
code below.)
# word and letter recognition data
# two within factors:
# word length: 4, 5, 6 letters
# letter position: 1-4 (in 4-letter words), 1-5 (in
5-letter words), 1-6 (in 6-letter words)
# one dependent variable:
#
2001 Nov 05
0
What kind of Ogg Vorbis-services you would like to h ave?
I know this is a little OT for the list and blatent advertising but
inkeeping with the thread topic, I've just finished a Windows playlist
generator for internet/radio stations. Suitable for highly automated
situations. Features anti-song repeat & anti-artist repeat options. No
song maintenance required. Works on a rotation or "clock" basis. Produces
a personalised HTML
2010 Jun 29
1
Performance enhancement for ave
library(plyr)
n<-100000
grp1<-sample(1:750, n, replace=T)
grp2<-sample(1:750, n, replace=T)
d<-data.frame(x=rnorm(n), y=rnorm(n), grp1=grp1, grp2=grp2)
system.time({
d$avx1 <- ave(d$x, list(d$grp1, d$grp2))
d$avy1 <- ave(d$y, list(d$grp1, d$grp2))
})
# user system elapsed
# 39.300 0.279 40.809
system.time({
d$avx2 <- ave(d$x, interaction(d$grp1, d$grp2, drop =
2009 Apr 19
1
ave returns wrong data type (PR#13664)
Full_Name: Brendan Barnwell
Version: 2.9.0
OS: Windows XP Pro
Submission from: (NULL) (71.102.131.29)
The ave() function returns an incorrect datatype. Specifically, ave(x, g, f)
always returns a vector with the same mode as x, rather than using the mode of
the vector returned by f. Observe:
> x
[1] "A" "B" "C" "A" "B" "C"
2010 Nov 16
0
LATTICE. On skip, index.cond with a formula like Y~X|A+B
Dear invaluable R-list,
my present problem is arranging/removing some panels in a lattice plot.
Please consider the following:
df.data <-
cbind.data.frame(expand.grid(SUBJ=1:5,
TREAT=LETTERS[1:4],
REF=letters[1:4]
)
)
df.data <-
2005 May 15
1
Not sure if this is "aggregate" or some other task.
I have data where where I've taken some measurements three times... twice in
rapid succession so I could check test-retest reliability of a piece of
equipment, and then a third measurement some time later.
Not I'd like to do an analysis where I have two scores... the first being
the mean of the first two taken the same day, and the second being the one
taken later.
I have a lot of
2008 May 30
2
inconsistent output when using variable substitution
I am extremely puzzled by this behavior in R. I have a data frame called
Trials in which I have results from an experiment. I am trying to do a
subjects analysis, but getting weird results. Each row has 1 trial in it,
which includes a column for the subject number I get the list of subject
numbers like so:
> Subj=unique(sort(Trials$Subj))
Then I loop over them. But I get strange results. As
2004 Aug 09
5
AW: built-in Sweave-like documentation in R-2.x
> See the 'Writing R Extensions' manual, specifically
> Creating R Packages -> Writing package vignettes
thank you, i saw this entry. However, this entry is rather
about how to include documents (in particular Sweave-based)
into a package. But I have meant smth else.
Let me explain in example. Today I use emacs as
environment for my R-sessions. I am quite happy to
use
2012 Jan 06
1
lme model specification problem (Error in MEEM...)
Dear all,
In lme, models in which a factor is fully "contained" in another lead to
an error. This is not the case when using lm/aov.
I understand that these factors are aliased, but believe that such
models make sense when the factors are fitted sequentially. For example,
I sometimes fit a factor first as linear term (continuous variable with
discrete levels, e.g. 1,2,4,6), and
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 Dec 17
1
repeated measures aov with weights
Dear R-help,
I'm facing a problem with defining a repeated measures anova with
weighted data.
Here's the code to reproduce the problem:
# generate some data
seed=11
rtrep <- data.frame(rt=rnorm(100),ti=rep(1:5,20),subj=gl
(20,5,100),we=runif(100))
# model with within factor for subjects/repeated measurements, no
problem
aov(rt~ti + Error(subj/ti),data=rtrep)
#model with weights